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 | 10 |
1 files changed, 4 insertions, 6 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 19e596a144..d33c36ef73 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 @@ -1,4 +1,6 @@ -require 'active_support/core_ext/module/attribute_accessors' +# frozen_string_literal: true + +require "active_support/core_ext/module/attribute_accessors" module DateAndTime module Compatibility @@ -9,10 +11,6 @@ module DateAndTime # of the receiver. For backwards compatibility we're overriding # this behavior, but new apps will have an initializer that sets # this to true, because the new behavior is preferred. - mattr_accessor(:preserve_timezone, instance_writer: false) { false } - - def to_time - preserve_timezone ? getlocal(utc_offset) : getlocal - end + mattr_accessor :preserve_timezone, instance_writer: false, default: false end end |