diff options
Diffstat (limited to 'activesupport/lib/active_support/core_ext/date_and_time/compatibility.rb')
-rw-r--r-- | activesupport/lib/active_support/core_ext/date_and_time/compatibility.rb | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/activesupport/lib/active_support/core_ext/date_and_time/compatibility.rb b/activesupport/lib/active_support/core_ext/date_and_time/compatibility.rb index db95ae0db5..3f4e236ab7 100644 --- a/activesupport/lib/active_support/core_ext/date_and_time/compatibility.rb +++ b/activesupport/lib/active_support/core_ext/date_and_time/compatibility.rb @@ -12,11 +12,7 @@ module DateAndTime mattr_accessor(:preserve_timezone, instance_writer: false) { false } def to_time - if preserve_timezone - @_to_time_with_instance_offset ||= getlocal(utc_offset) - else - @_to_time_with_system_offset ||= getlocal - end + preserve_timezone ? getlocal(utc_offset) : getlocal end end end |