Merge pull request #10373 from janko-m/fix-store-accessor

Fix a bug in ActiveRecord::Store accessors
This commit is contained in:
Carlos Antonio da Silva
2013-06-25 22:03:01 -03:00
3 changed files with 13 additions and 1 deletions

View File

@@ -37,8 +37,8 @@ module ActiveRecord
Array(keys).flatten.each do |key|
define_method("#{key}=") do |value|
send("#{store_attribute}=", {}) unless send(store_attribute).is_a?(Hash)
send(store_attribute)[key] = value
send("#{store_attribute}_will_change!")
send(store_attribute)[key] = value
end
define_method(key) do