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:
commit
3132fa6b7d
@ -80,7 +80,7 @@ def in_time_zone(new_zone = ::Time.zone)
|
||||
|
||||
# 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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user