aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--activerecord/lib/active_record/transactions.rb5
-rw-r--r--activerecord/test/cases/transaction_callbacks_test.rb12
2 files changed, 6 insertions, 11 deletions
diff --git a/activerecord/lib/active_record/transactions.rb b/activerecord/lib/active_record/transactions.rb
index 9e48228a40..0a55ef2b53 100644
--- a/activerecord/lib/active_record/transactions.rb
+++ b/activerecord/lib/active_record/transactions.rb
@@ -170,11 +170,6 @@ module ActiveRecord
# are called on every record saved or destroyed within a transaction immediately after the
# transaction or savepoint is rolled back.
#
- # Additionally, there are callbacks for after_commit_on_create, after_rollback_on_create,
- # after_commit_on_update, after_rollback_on_update, after_commit_on_destroy, and
- # after_rollback_on_destroy which are only called if a record is created, updated or destroyed
- # in the transaction.
- #
# These callbacks are useful for interacting with other systems since you will be guaranteed
# that the callback is only executed when the database is in a permanent state. For example,
# after_commit is a good spot to put in a hook to clearing a cache since clearing it from
diff --git a/activerecord/test/cases/transaction_callbacks_test.rb b/activerecord/test/cases/transaction_callbacks_test.rb
index c2c5fd3b05..a07da093f1 100644
--- a/activerecord/test/cases/transaction_callbacks_test.rb
+++ b/activerecord/test/cases/transaction_callbacks_test.rb
@@ -10,13 +10,13 @@ class TransactionCallbacksTest < ActiveRecord::TestCase
set_table_name :topics
after_commit{|record| record.send(:do_after_commit, nil)}
- after_commit_on_create{|record| record.send(:do_after_commit, :create)}
- after_commit_on_update{|record| record.send(:do_after_commit, :update)}
- after_commit_on_destroy{|record| record.send(:do_after_commit, :destroy)}
+ after_commit(:on => :create){|record| record.send(:do_after_commit, :create)}
+ after_commit(:on => :update){|record| record.send(:do_after_commit, :update)}
+ after_commit(:on => :destroy){|record| record.send(:do_after_commit, :destroy)}
after_rollback{|record| record.send(:do_after_rollback, nil)}
- after_rollback_on_create{|record| record.send(:do_after_rollback, :create)}
- after_rollback_on_update{|record| record.send(:do_after_rollback, :update)}
- after_rollback_on_destroy{|record| record.send(:do_after_rollback, :destroy)}
+ after_rollback(:on => :create){|record| record.send(:do_after_rollback, :create)}
+ after_rollback(:on => :update){|record| record.send(:do_after_rollback, :update)}
+ after_rollback(:on => :destroy){|record| record.send(:do_after_rollback, :destroy)}
def history
@history ||= []