Method: ActiveRecord.all_open_transactions

Defined in:
activerecord/lib/active_record.rb

.all_open_transactionsObject

:nodoc:



577
578
579
580
581
582
583
584
585
586
587
# File 'activerecord/lib/active_record.rb', line 577

def self.all_open_transactions # :nodoc:
  open_transactions = []
  Base.connection_handler.each_connection_pool do |pool|
    if active_connection = pool.active_connection
      if active_connection.current_transaction.open? && active_connection.current_transaction.joinable?
        open_transactions << active_connection.current_transaction
      end
    end
  end
  open_transactions
end