File tree Expand file tree Collapse file tree 2 files changed +2
-30
lines changed
activesupport/lib/active_support/core_ext Expand file tree Collapse file tree 2 files changed +2
-30
lines changed Original file line number Diff line number Diff line change 11require 'active_support/core_ext/time/acts_like'
22require 'active_support/core_ext/time/calculations'
33require 'active_support/core_ext/time/conversions'
4- require 'active_support/core_ext/time/marshal'
54require 'active_support/core_ext/time/zones'
Original file line number Diff line number Diff line change 1- # Ruby 1.9.2 adds utc_offset and zone to Time, but marshaling only
2- # preserves utc_offset. Preserve zone also, even though it may not
3- # work in some edge cases.
4- if Time . local ( 2010 ) . zone != Marshal . load ( Marshal . dump ( Time . local ( 2010 ) ) ) . zone
5- class Time
6- class << self
7- alias_method :_load_without_zone , :_load
8- def _load ( marshaled_time )
9- time = _load_without_zone ( marshaled_time )
10- time . instance_eval do
11- if zone = defined? ( @_zone ) && remove_instance_variable ( '@_zone' )
12- ary = to_a
13- ary [ 0 ] += subsec if ary [ 0 ] == sec
14- ary [ -1 ] = zone
15- utc? ? Time . utc ( *ary ) : Time . local ( *ary )
16- else
17- self
18- end
19- end
20- end
21- end
1+ require 'active_support/deprecation'
222
23- alias_method :_dump_without_zone , :_dump
24- def _dump ( *args )
25- obj = dup
26- obj . instance_variable_set ( '@_zone' , zone )
27- obj . send :_dump_without_zone , *args
28- end
29- end
30- end
3+ ActiveSupport ::Deprecation . warn ( "This is deprecated and will be removed in Rails 5.1 with no replacement." )
You can’t perform that action at this time.
0 commit comments