Permalink
Browse files

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

Signed-off-by: José Valim <jose.valim@gmail.com>
  • Loading branch information...
jlewallen authored and josevalim committed Jul 7, 2010
1 parent 16bae77 commit d10ecfefb8bd4461127f552f14970ad6b3df507f
@@ -124,6 +124,7 @@ def destroy #: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

0 comments on commit d10ecfe

Please sign in to comment.