From 7f13c75447dc739dfa549d8161a9a9c7f7fdca32 Mon Sep 17 00:00:00 2001 From: Toby Hede Date: Fri, 26 Jul 2013 15:25:49 +1000 Subject: [PATCH] remove dependency on active_support's present? method --- lib/fog/atmos/models/storage/file.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/fog/atmos/models/storage/file.rb b/lib/fog/atmos/models/storage/file.rb index 71938e565..b5dacda61 100644 --- a/lib/fog/atmos/models/storage/file.rb +++ b/lib/fog/atmos/models/storage/file.rb @@ -58,8 +58,8 @@ module Fog # By default, expire in 5 years def public_url(expires = (Time.now + 5 * 365 * 24 * 60 * 60)) file = directory.files.head(key) - self.objectid = if file.present? then file.attributes['x-emc-meta'].scan(/objectid=(\w+),/).flatten[0] else nil end - if self.objectid.present? + self.objectid = if file && file.to_s.strip != "" then file.attributes['x-emc-meta'].scan(/objectid=(\w+),/).flatten[0] else nil end + if self.objectid && self.objectid.to_s.strip != "" uri = URI::HTTP.build(:scheme => service.ssl? ? "http" : "https" , :host => service.host, :port => service.port.to_i, :path => "/rest/objects/#{self.objectid}" ) sb = "GET\n"