提交 5daf0770 编写于 作者: D David Heinemeier Hansson

Fix that changing a store should mark the store attribute as changed

上级 85b64f98
......@@ -37,6 +37,7 @@ def store_accessor(store_attribute, *keys)
Array(keys).flatten.each do |key|
define_method("#{key}=") do |value|
send(store_attribute)[key] = value
send("#{store_attribute}_will_change!")
end
define_method(key) do
......
......@@ -26,4 +26,9 @@ class StoreTest < ActiveRecord::TestCase
assert 'graeters', @john.reload.settings[:icecream]
end
test "updating the store will mark it as changed" do
@john.color = 'red'
assert @john.settings_changed?
end
end
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册