mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Make should_record_timestamps? serialization aware rather than object#changed?
This commit is contained in:
parent
e911ed1f0f
commit
18b6aa6538
2 changed files with 1 additions and 5 deletions
|
@ -41,10 +41,6 @@ module ActiveRecord
|
|||
end
|
||||
end
|
||||
|
||||
def changed?
|
||||
super || (attributes.keys & self.class.serialized_attributes.keys).present?
|
||||
end
|
||||
|
||||
private
|
||||
# Wrap write_attribute to remember original attribute value.
|
||||
def write_attribute(attr, value)
|
||||
|
|
|
@ -61,7 +61,7 @@ module ActiveRecord
|
|||
end
|
||||
|
||||
def should_record_timestamps?
|
||||
record_timestamps && (!partial_updates? || changed?)
|
||||
record_timestamps && (!partial_updates? || changed? || (attributes.keys & self.class.serialized_attributes.keys).present?)
|
||||
end
|
||||
|
||||
def timestamp_attributes_for_update_in_model
|
||||
|
|
Loading…
Reference in a new issue