aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2019-04-30 22:43:29 +0900
committerGitHub <noreply@github.com>2019-04-30 22:43:29 +0900
commit7575242e833fbee7be72fb9cce6259c027dbabb2 (patch)
tree1d686c42b71857de97df6a439d72b5b23f5b1249 /activerecord/test
parenta023e2180093ebc517a642aaf21f3c7241c67657 (diff)
parente0a315b38aae8cb748597a89786c2249627c4495 (diff)
downloadrails-7575242e833fbee7be72fb9cce6259c027dbabb2.tar.gz
rails-7575242e833fbee7be72fb9cce6259c027dbabb2.tar.bz2
rails-7575242e833fbee7be72fb9cce6259c027dbabb2.zip
Merge pull request #36142 from kamipo/should_take_first_record_state
Should take the record's state of first action in the transaction
Diffstat (limited to 'activerecord/test')
-rw-r--r--activerecord/test/cases/transaction_callbacks_test.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/activerecord/test/cases/transaction_callbacks_test.rb b/activerecord/test/cases/transaction_callbacks_test.rb
index 53fe31e087..135e2cb382 100644
--- a/activerecord/test/cases/transaction_callbacks_test.rb
+++ b/activerecord/test/cases/transaction_callbacks_test.rb
@@ -36,6 +36,8 @@ class TransactionCallbacksTest < ActiveRecord::TestCase
has_many :replies, class_name: "ReplyWithCallbacks", foreign_key: "parent_id"
+ before_destroy { self.class.find(id).touch if persisted? }
+
before_commit { |record| record.do_before_commit(nil) }
after_commit { |record| record.do_after_commit(nil) }
after_save_commit { |record| record.do_after_commit(:save) }