diff --git a/activerecord/lib/active_record/transactions.rb b/activerecord/lib/active_record/transactions.rb
index 27d9b637339fd..9c10b25ae5198 100644
--- a/activerecord/lib/active_record/transactions.rb
+++ b/activerecord/lib/active_record/transactions.rb
@@ -188,16 +188,6 @@ module Transactions
# #after_commit is a good spot to put in a hook to clearing a cache since clearing it from
# within a transaction could trigger the cache to be regenerated before the database is updated.
#
- # *Warning*: Callbacks are deduplicated according to the callback and method.
- # This means you cannot have multiple after_xxx_commit shortcuts calling the same method.
- #
- # after_create_commit :do_foo # This will NOT fire
- # after_save_commit :do_foo
- #
- # Instead, use after_commit directly
- #
- # after_commit :do_foo, on: [:create, :save]
- #
# === Caveats
#
# If you're on MySQL, then do not use Data Definition Language (DDL) operations in nested
@@ -252,32 +242,24 @@ def after_commit(*args, &block)
end
# Shortcut for after_commit :hook, on: [ :create, :update ].
- #
- # *Warning*: only one after_xxx_commit shortcut can call any given method.
def after_save_commit(*args, &block)
set_options_for_callbacks!(args, on: [ :create, :update ], **prepend_option)
set_callback(:commit, :after, *args, &block)
end
# Shortcut for after_commit :hook, on: :create.
- #
- # *Warning*: only one after_xxx_commit shortcut can call any given method.
def after_create_commit(*args, &block)
set_options_for_callbacks!(args, on: :create, **prepend_option)
set_callback(:commit, :after, *args, &block)
end
# Shortcut for after_commit :hook, on: :update.
- #
- # *Warning*: only one after_xxx_commit shortcut can call any given method.
def after_update_commit(*args, &block)
set_options_for_callbacks!(args, on: :update, **prepend_option)
set_callback(:commit, :after, *args, &block)
end
# Shortcut for after_commit :hook, on: :destroy.
- #
- # *Warning*: only one after_xxx_commit shortcut can call any given method.
def after_destroy_commit(*args, &block)
set_options_for_callbacks!(args, on: :destroy, **prepend_option)
set_callback(:commit, :after, *args, &block)