aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
authorPratik Naik <pratiknaik@gmail.com>2010-11-02 01:42:47 +0000
committerPratik Naik <pratiknaik@gmail.com>2010-11-02 01:42:49 +0000
commite911ed1f0f1633b0ae1b5146805eee6388b1f02f (patch)
tree3b965b11bb7925623d2d7f23f90e3f1391be0a36 /activerecord/lib/active_record
parentc5c2e4fefde539e1c1753d4ca184c3bf81d496be (diff)
downloadrails-e911ed1f0f1633b0ae1b5146805eee6388b1f02f.tar.gz
rails-e911ed1f0f1633b0ae1b5146805eee6388b1f02f.tar.bz2
rails-e911ed1f0f1633b0ae1b5146805eee6388b1f02f.zip
Ensure save always updates timestamps when serialized attributes are present
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r--activerecord/lib/active_record/attribute_methods/dirty.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/attribute_methods/dirty.rb b/activerecord/lib/active_record/attribute_methods/dirty.rb
index 439880c1fa..78a941b5d4 100644
--- a/activerecord/lib/active_record/attribute_methods/dirty.rb
+++ b/activerecord/lib/active_record/attribute_methods/dirty.rb
@@ -41,6 +41,10 @@ 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)