aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
authorMatt Jones <al2o3cr@gmail.com>2012-09-05 11:01:26 -0400
committerMatt Jones <al2o3cr@gmail.com>2012-09-05 11:01:26 -0400
commit20f943ffd86ae3f74cc16c6f85fb7cc2a43da388 (patch)
treee47f1ed8922a0a0b3aa92a6ffa134e89cc47fe42 /activerecord/lib/active_record
parent27acd1e0d29c43dddd9c62b041a16c6e71e7bcf4 (diff)
downloadrails-20f943ffd86ae3f74cc16c6f85fb7cc2a43da388.tar.gz
rails-20f943ffd86ae3f74cc16c6f85fb7cc2a43da388.tar.bz2
rails-20f943ffd86ae3f74cc16c6f85fb7cc2a43da388.zip
correctly flag changed attributes in AR::Store, combine multiple calls to store_accessor
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r--activerecord/lib/active_record/store.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/store.rb b/activerecord/lib/active_record/store.rb
index b4013ecc1e..25f528498e 100644
--- a/activerecord/lib/active_record/store.rb
+++ b/activerecord/lib/active_record/store.rb
@@ -57,8 +57,8 @@ module ActiveRecord
define_method("#{key}=") do |value|
attribute = initialize_store_attribute(store_attribute)
if value != attribute[key]
- attribute[key] = value
send :"#{store_attribute}_will_change!"
+ attribute[key] = value
end
end
@@ -67,7 +67,8 @@ module ActiveRecord
end
end
- self.stored_attributes[store_attribute] = keys
+ self.stored_attributes[store_attribute] ||= []
+ self.stored_attributes[store_attribute] |= keys
end
end