method

after_rollback

after_rollback(&block)
public

Registers a block to be called after the transaction is rolled back.

If there is no currently open transactions, the block is not called. But if the transaction is finalized, attempting to register the callback raises ActiveRecord::ActiveRecordError.

If the transaction is successfully committed but has a parent transaction, the callback is automatically added to the parent transaction.

If the entire chain of nested transactions are all successfully committed, the block is never called.

If the transaction is already finalized, attempting to register a callback will raise ActiveRecord::ActiveRecordError.