提交 8298bef7 编写于 作者: J Jacob Lewallen 提交者: José Valim

Set destroyed=true in opt locking's destroy [#5058 state:resolved]

Signed-off-by: NJosé Valim <jose.valim@gmail.com>
上级 046c900d
......@@ -128,6 +128,7 @@ def destroy_with_lock #:nodoc:
end
end
@destroyed = true
freeze
end
......
......@@ -53,7 +53,8 @@ def test_lock_destroy
assert_raises(ActiveRecord::StaleObjectError) { p2.destroy }
assert p1.destroy
assert_equal true, p1.frozen?
assert p1.frozen?
assert p1.destroyed?
assert_raises(ActiveRecord::RecordNotFound) { Person.find(1) }
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册