Make should_record_timestamps? serialization aware rather than object#changed?

This commit is contained in:
Pratik Naik 2010-11-02 01:45:30 +00:00
parent e911ed1f0f
commit 18b6aa6538
2 changed files with 1 additions and 5 deletions

View File

@ -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)

View File

@ -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