diff options
author | Mike Breen <hardbap@gmail.com> | 2009-08-09 16:34:05 +0100 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2009-08-09 16:34:53 +0100 |
commit | 7d254b5d74144a1e217125e7be21882ce380a3f8 (patch) | |
tree | 6da12d509e70a8dc0c824d6111f27bc0404e100a /activerecord/lib | |
parent | 96b575d6dcea6c9c4a716b4929c319695afa59f3 (diff) | |
download | rails-7d254b5d74144a1e217125e7be21882ce380a3f8.tar.gz rails-7d254b5d74144a1e217125e7be21882ce380a3f8.tar.bz2 rails-7d254b5d74144a1e217125e7be21882ce380a3f8.zip |
Serialized attributes should only be saved with partial_updates when the serialized attribute is present [#2397 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/attribute_methods/dirty.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/attribute_methods/dirty.rb b/activerecord/lib/active_record/attribute_methods/dirty.rb index 9ec1fbeee1..911c908c8b 100644 --- a/activerecord/lib/active_record/attribute_methods/dirty.rb +++ b/activerecord/lib/active_record/attribute_methods/dirty.rb @@ -161,7 +161,7 @@ module ActiveRecord if partial_updates? # Serialized attributes should always be written in case they've been # changed in place. - update_without_dirty(changed | self.class.serialized_attributes.keys) + update_without_dirty(changed | (attributes.keys & self.class.serialized_attributes.keys)) else update_without_dirty end |