method

after_all_transactions_commit

rails latest stable - Class: ActiveRecord

Method not available on this version

This method is only available on newer versions. The first available version (v8.0.0) is shown here.

after_all_transactions_commit(&block)
public

Registers a block to be called after all the current transactions have been committed.

If there is no currently open transaction, the block is called immediately.

If there are multiple nested transactions, the block is called after the outermost one has been committed,

If any of the currently open transactions is rolled back, the block is never called.

If multiple transactions are open across multiple databases, the block will be invoked if and once all of them have been committed. But note that nesting transactions across two distinct databases is a sharding anti-pattern that comes with a world of hurts.