Skip to content
Browse files

Don't store incorrect values in zones_map backport

[#4942 state:committed]

Signed-off-by: José Valim <jose.valim@gmail.com>
  • Loading branch information...
1 parent 56b35af commit 70af7efa16fa429f7bbc3acfc1c587c8655edf7e @spastorino spastorino committed with josevalim Jun 28, 2010
Showing with 3 additions and 1 deletion.
  1. +3 −1 activesupport/lib/active_support/values/time_zone.rb
View
4 activesupport/lib/active_support/values/time_zone.rb
@@ -387,7 +387,9 @@ def zones_map
def [](arg)
case arg
when String
- zones_map[arg] ||= lookup(arg)
+ if tz = lookup(arg)
+ zones_map[arg] ||= tz
+ end
when Numeric, ActiveSupport::Duration
arg *= 3600 if arg.abs <= 13
all.find { |z| z.utc_offset == arg.to_i }

0 comments on commit 70af7ef

Please sign in to comment.
Something went wrong with that request. Please try again.