Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Remove stray instance variable to resolve serialization problem [#3769

…state:resolved] (ht: Joe Rafaniello)
  • Loading branch information...
commit 26e714d26eff2633fd33ba6f21295a376fcad091 1 parent bc4cdae
@wycats wycats authored
View
12 activesupport/lib/active_support/core_ext/time/marshal_with_utc_flag.rb
@@ -7,14 +7,20 @@ class << self
alias_method :_original_load, :_load
def _load(marshaled_time)
time = _original_load(marshaled_time)
- utc = time.instance_variable_get('@marshal_with_utc_coercion')
- utc ? time.utc : time
+ time.instance_eval do
+ if defined?(@marshal_with_utc_coercion)
+ remove_instance_variable("@marshal_with_utc_coercion")
+ utc
+ else
+ self
+ end
+ end
end
end
alias_method :_original_dump, :_dump
def _dump(*args)
- obj = frozen? ? dup : self
+ obj = dup
obj.instance_variable_set('@marshal_with_utc_coercion', utc?)
obj._original_dump(*args)
end
Please sign in to comment.
Something went wrong with that request. Please try again.