aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/values
diff options
context:
space:
mode:
authorSantiago Pastorino <santiago@wyeworks.com>2010-04-15 01:10:04 -0300
committerJeremy Kemper <jeremy@bitsweat.net>2010-04-14 21:15:15 -0700
commita0cc94b32e5b4e4dce50787eed1208406f99ea82 (patch)
tree2be64d72a3e0a579be9b6b211f42dbe316bd62eb /activesupport/lib/active_support/values
parente79193f852238816a9eeb26fbf1e94b369911718 (diff)
downloadrails-a0cc94b32e5b4e4dce50787eed1208406f99ea82.tar.gz
rails-a0cc94b32e5b4e4dce50787eed1208406f99ea82.tar.bz2
rails-a0cc94b32e5b4e4dce50787eed1208406f99ea82.zip
utc_offset returns nil for unknown zones
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
Diffstat (limited to 'activesupport/lib/active_support/values')
-rw-r--r--activesupport/lib/active_support/values/time_zone.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/values/time_zone.rb b/activesupport/lib/active_support/values/time_zone.rb
index 03b324764b..9db6bbafca 100644
--- a/activesupport/lib/active_support/values/time_zone.rb
+++ b/activesupport/lib/active_support/values/time_zone.rb
@@ -1,4 +1,5 @@
require 'active_support/core_ext/object/blank'
+require 'active_support/core_ext/object/try'
# The TimeZone class serves as a wrapper around TZInfo::Timezone instances. It allows us to do the following:
#
@@ -205,8 +206,8 @@ module ActiveSupport
if @utc_offset
@utc_offset
else
- @current_period ||= tzinfo.current_period
- @current_period.utc_offset
+ @current_period ||= tzinfo.try(:current_period)
+ @current_period.try(:utc_offset)
end
end