aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSantiago Pastorino <santiago@wyeworks.com>2010-03-30 20:24:43 -0300
committerJeremy Kemper <jeremy@bitsweat.net>2010-03-30 16:36:16 -0700
commit7d0eea179b15c888d8e66654ea7922a9d70831e5 (patch)
treef5a521e1720f263840bc0bc829393cdc7871a06c
parent1412ad437eabc76098c698fa10f92d6f3247bb58 (diff)
downloadrails-7d0eea179b15c888d8e66654ea7922a9d70831e5.tar.gz
rails-7d0eea179b15c888d8e66654ea7922a9d70831e5.tar.bz2
rails-7d0eea179b15c888d8e66654ea7922a9d70831e5.zip
Don't cache the utc_offset we are already caching the timezone [#4301 state:committed]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
-rw-r--r--activesupport/lib/active_support/values/time_zone.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/values/time_zone.rb b/activesupport/lib/active_support/values/time_zone.rb
index 3cb4d89e02..945cdd5278 100644
--- a/activesupport/lib/active_support/values/time_zone.rb
+++ b/activesupport/lib/active_support/values/time_zone.rb
@@ -198,10 +198,12 @@ module ActiveSupport
@name = name
@utc_offset = utc_offset
@tzinfo = tzinfo
+ @current_period = nil
end
def utc_offset
- @utc_offset ||= tzinfo.current_period.utc_offset
+ @current_period ||= tzinfo.current_period
+ @current_period.utc_offset
end
# Returns the offset of this time zone as a formatted string, of the
@@ -362,13 +364,14 @@ module ActiveSupport
"Wellington" ],
[ 46_800, "Nuku'alofa" ]].
each do |offset, *places|
- places.sort.each do |place|
+ places.each do |place|
place.freeze
zone = new(place, offset)
ZONES << zone
ZONES_MAP[place] = zone
end
end
+ ZONES.sort!
ZONES.freeze
ZONES_MAP.freeze