From 7402e8b04b75100bc90dcf4ac43c285576d0fb87 Mon Sep 17 00:00:00 2001 From: geemus Date: Fri, 10 Jun 2011 10:53:20 -0700 Subject: [PATCH] [storage|rackspace] fix files#get_url --- lib/fog/storage/models/rackspace/file.rb | 6 ++---- lib/fog/storage/models/rackspace/files.rb | 6 ++++-- 2 files changed, 6 insertions(+), 6 deletions(-) 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 = {})