提交 26e714d2 编写于 作者: W wycats

Remove stray instance variable to resolve serialization problem [#3769...

Remove stray instance variable to resolve serialization problem [#3769 state:resolved] (ht: Joe Rafaniello)
上级 bc4cdae3
...@@ -7,14 +7,20 @@ class << self ...@@ -7,14 +7,20 @@ class << self
alias_method :_original_load, :_load alias_method :_original_load, :_load
def _load(marshaled_time) def _load(marshaled_time)
time = _original_load(marshaled_time) time = _original_load(marshaled_time)
utc = time.instance_variable_get('@marshal_with_utc_coercion') time.instance_eval do
utc ? time.utc : time if defined?(@marshal_with_utc_coercion)
remove_instance_variable("@marshal_with_utc_coercion")
utc
else
self
end
end
end end
end end
alias_method :_original_dump, :_dump alias_method :_original_dump, :_dump
def _dump(*args) def _dump(*args)
obj = frozen? ? dup : self obj = dup
obj.instance_variable_set('@marshal_with_utc_coercion', utc?) obj.instance_variable_set('@marshal_with_utc_coercion', utc?)
obj._original_dump(*args) obj._original_dump(*args)
end end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册