1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Merge pull request #25880 from ryandv/fix_performance_regression_in_timewithzone_to_time

Fix performance regression in `TimeWithZone#to_time`
This commit is contained in:
Andrew White 2016-08-30 08:42:45 +01:00 committed by GitHub
commit 3132fa6b7d

View file

@ -80,7 +80,7 @@ module ActiveSupport
# Returns a <tt>Time</tt> instance of the simultaneous time in the system timezone.
def localtime(utc_offset = nil)
utc.getlocal(utc_offset)
@localtime ||= utc.getlocal(utc_offset)
end
alias_method :getlocal, :localtime