Implement ActiveRecord::Transaction callbacks

What does this MR do and why?

This change implements callbacks to run after committing ActiveRecord transactions.

ApplicationRecord.transaction do
  # Alter the data

  ApplicationRecord.current_transaction.after_commit do
    # Do something that needs to be done after the transaction commits
    # like scheduling a Sidekiq job, etc.
  end

  # Maybe even more queries to alter the data
end

Relates to #549584 (closed)

Edited by Bala Kumar

Merge request reports

Loading