aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2012-09-05 15:33:48 -0700
committerRafael Mendonça França <rafaelmfranca@gmail.com>2012-09-05 15:33:48 -0700
commit2197d61c69d3e1d536dc54e2c0994d2adbe40d18 (patch)
tree1afdd6d6a63d8ab869c6307a373774aa623cf96e /activerecord/lib
parentebc4d8cede42b2e199a589904ceac6b4dc69eab5 (diff)
parent20f943ffd86ae3f74cc16c6f85fb7cc2a43da388 (diff)
downloadrails-2197d61c69d3e1d536dc54e2c0994d2adbe40d18.tar.gz
rails-2197d61c69d3e1d536dc54e2c0994d2adbe40d18.tar.bz2
rails-2197d61c69d3e1d536dc54e2c0994d2adbe40d18.zip
Merge pull request #7532 from al2o3cr/fix_store_bugs
correct handling of changes in AR::Store, combine multiple store_accessors
Diffstat (limited to 'activerecord/lib')
-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