Skip to content

Commit

Permalink
Don't cache the utc_offset we are already caching the timezone [#4301]
Browse files Browse the repository at this point in the history
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
  • Loading branch information
spastorino authored and jeremy committed Mar 30, 2010
1 parent 4b08679 commit e329eab
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion activesupport/lib/active_support/values/time_zone.rb
Expand Up @@ -181,10 +181,12 @@ def initialize(name, utc_offset, tzinfo = nil)
@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
Expand Down

0 comments on commit e329eab

Please sign in to comment.