@@ -188,16 +188,6 @@ module Transactions
188
188
# #after_commit is a good spot to put in a hook to clearing a cache since clearing it from
189
189
# within a transaction could trigger the cache to be regenerated before the database is updated.
190
190
#
191
- # *Warning*: Callbacks are deduplicated according to the callback and method.
192
- # This means you cannot have multiple <tt>after_xxx_commit</tt> shortcuts calling the same method.
193
- #
194
- # after_create_commit :do_foo # This will NOT fire
195
- # after_save_commit :do_foo
196
- #
197
- # Instead, use after_commit directly
198
- #
199
- # after_commit :do_foo, on: [:create, :save]
200
- #
201
191
# === Caveats
202
192
#
203
193
# 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)
252
242
end
253
243
254
244
# Shortcut for <tt>after_commit :hook, on: [ :create, :update ]</tt>.
255
- #
256
- # *Warning*: only one <tt>after_xxx_commit</tt> shortcut can call any given method.
257
245
def after_save_commit ( *args , &block )
258
246
set_options_for_callbacks! ( args , on : [ :create , :update ] , **prepend_option )
259
247
set_callback ( :commit , :after , *args , &block )
260
248
end
261
249
262
250
# Shortcut for <tt>after_commit :hook, on: :create</tt>.
263
- #
264
- # *Warning*: only one <tt>after_xxx_commit</tt> shortcut can call any given method.
265
251
def after_create_commit ( *args , &block )
266
252
set_options_for_callbacks! ( args , on : :create , **prepend_option )
267
253
set_callback ( :commit , :after , *args , &block )
268
254
end
269
255
270
256
# Shortcut for <tt>after_commit :hook, on: :update</tt>.
271
- #
272
- # *Warning*: only one <tt>after_xxx_commit</tt> shortcut can call any given method.
273
257
def after_update_commit ( *args , &block )
274
258
set_options_for_callbacks! ( args , on : :update , **prepend_option )
275
259
set_callback ( :commit , :after , *args , &block )
276
260
end
277
261
278
262
# Shortcut for <tt>after_commit :hook, on: :destroy</tt>.
279
- #
280
- # *Warning*: only one <tt>after_xxx_commit</tt> shortcut can call any given method.
281
263
def after_destroy_commit ( *args , &block )
282
264
set_options_for_callbacks! ( args , on : :destroy , **prepend_option )
283
265
set_callback ( :commit , :after , *args , &block )
0 commit comments