diff options
author | brainopia <brainopia@evilmartians.com> | 2014-12-25 23:33:47 +0300 |
---|---|---|
committer | Sean Griffin <sean@thoughtbot.com> | 2014-12-26 13:11:10 -0700 |
commit | c6fd24643604b5779a76527e6364f21ee5cc3ce0 (patch) | |
tree | b488c83e1952f45f2079d4c6ad35f5ca4761afbb /activerecord/test | |
parent | a983e1e89c6f55cd08feb394db33ca0620fadfd1 (diff) | |
download | rails-c6fd24643604b5779a76527e6364f21ee5cc3ce0.tar.gz rails-c6fd24643604b5779a76527e6364f21ee5cc3ce0.tar.bz2 rails-c6fd24643604b5779a76527e6364f21ee5cc3ce0.zip |
Propagate frozen state during transaction changes
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/transactions_test.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/activerecord/test/cases/transactions_test.rb b/activerecord/test/cases/transactions_test.rb index cf50bd4ddb..34afbb0a45 100644 --- a/activerecord/test/cases/transactions_test.rb +++ b/activerecord/test/cases/transactions_test.rb @@ -562,6 +562,20 @@ class TransactionTest < ActiveRecord::TestCase assert !@second.destroyed?, 'not destroyed' end + def test_restore_frozen_state_after_double_destroy + topic = Topic.create + reply = topic.replies.create + + Topic.transaction do + topic.destroy # calls #destroy on reply (since dependent: destroy) + reply.destroy + + raise ActiveRecord::Rollback + end + + assert !reply.frozen?, 'not frozen' + end + def test_sqlite_add_column_in_transaction return true unless current_adapter?(:SQLite3Adapter) |