提交 635032fe 编写于 作者: K kennyj

Fix #6591. If a field with timezone isn't changed, we don't call will_change!.

上级 cfc7f602
......@@ -57,8 +57,9 @@ def #{attr_name}=(original_time)
time = time.is_a?(String) ? Time.zone.parse(time) : time.to_time rescue time
end
time = time.in_time_zone rescue nil if time
changed = read_attribute(:#{attr_name}) != time
write_attribute(:#{attr_name}, original_time)
#{attr_name}_will_change!
#{attr_name}_will_change! if changed
@attributes_cache["#{attr_name}"] = time
end
EOV
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册