aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/time_with_zone.rb
diff options
context:
space:
mode:
authorAndrew White <pixeltrix@users.noreply.github.com>2016-10-01 21:30:02 +0100
committerGitHub <noreply@github.com>2016-10-01 21:30:02 +0100
commit9ce2d1b1a43fc4ef3db59849b7412d30583a4074 (patch)
treed70ff8a043c9ed6938c925bc354b4dca8ff31060 /activesupport/lib/active_support/time_with_zone.rb
parent53ede1aff2025d4391d0e05ba471fdaf3110a99c (diff)
parent607a6c7a9a6fb3d8bd7d08d0307018b626105d83 (diff)
downloadrails-9ce2d1b1a43fc4ef3db59849b7412d30583a4074.tar.gz
rails-9ce2d1b1a43fc4ef3db59849b7412d30583a4074.tar.bz2
rails-9ce2d1b1a43fc4ef3db59849b7412d30583a4074.zip
Merge pull request #26677 from tbalthazar/26644
Fix `ActiveSupport::TimeWithZone#localtime`
Diffstat (limited to 'activesupport/lib/active_support/time_with_zone.rb')
-rw-r--r--activesupport/lib/active_support/time_with_zone.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/time_with_zone.rb b/activesupport/lib/active_support/time_with_zone.rb
index c35588fbae..bee481e5f5 100644
--- a/activesupport/lib/active_support/time_with_zone.rb
+++ b/activesupport/lib/active_support/time_with_zone.rb
@@ -80,7 +80,8 @@ module ActiveSupport
# Returns a <tt>Time</tt> instance of the simultaneous time in the system timezone.
def localtime(utc_offset = nil)
- @localtime ||= utc.getlocal(utc_offset)
+ @localtime ||= {}
+ @localtime[utc_offset] ||= utc.getlocal(utc_offset)
end
alias_method :getlocal, :localtime