Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
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...
commit d10ecfefb8bd4461127f552f14970ad6b3df507f 1 parent 16bae77
@jlewallen jlewallen authored josevalim committed
View
1  activerecord/lib/active_record/locking/optimistic.rb
@@ -124,6 +124,7 @@ def destroy #:nodoc:
end
end
+ @destroyed = true
freeze
end
View
3  activerecord/test/cases/locking_test.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.