diff --git a/lib/fog/storage/models/rackspace/file.rb b/lib/fog/storage/models/rackspace/file.rb index 4ffbf0543..89fb1267a 100644 --- a/lib/fog/storage/models/rackspace/file.rb +++ b/lib/fog/storage/models/rackspace/file.rb @@ -49,10 +49,8 @@ module Fog end def public_url - requires :directory, :key - if @directory.public_url - "#{@directory.public_url}/#{key}" - end + requires :key + self.collection.get_url(self.key) end def save(options = {}) diff --git a/lib/fog/storage/models/rackspace/files.rb b/lib/fog/storage/models/rackspace/files.rb index 5a8c75970..a87c204b2 100644 --- a/lib/fog/storage/models/rackspace/files.rb +++ b/lib/fog/storage/models/rackspace/files.rb @@ -64,9 +64,11 @@ module Fog nil end - def get_url(key, expires) + def get_url(key) requires :directory - connection.get_object_url(directory.key, key, expires) + if self.directory.public_url + "#{self.directory.public_url}/#{key}" + end end def head(key, options = {})