123456789_123456789_123456789_123456789_123456789_

Class: ActiveRecord::ConnectionAdapters::RealTransaction

Relationships & Source Files
Inherits: ActiveRecord::ConnectionAdapters::Transaction
  • ::Object
Defined in: activerecord/lib/active_record/connection_adapters/abstract/transaction.rb

Class Method Summary

Instance Method Summary

Constructor Details

.new(connection, options) ⇒ RealTransaction

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/abstract/transaction.rb', line 135

def initialize(connection, options)
  super
  if options[:isolation]
    connection.begin_isolated_db_transaction(options[:isolation])
  else
    connection.begin_db_transaction
  end
end

Instance Method Details

#commit

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/abstract/transaction.rb', line 150

def commit
  connection.commit_db_transaction
  super
  commit_records
end

#rollback

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/abstract/transaction.rb', line 144

def rollback
  connection.rollback_db_transaction
  super
  rollback_records
end