Make should_record_timestamps? serialization aware rather than object#changed?
This commit is contained in:
parent
e911ed1f0f
commit
18b6aa6538
|
@ -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 New Issue