Skip to Content Skip to Search

class ActiveRecord::ConnectionAdapters::RestartParentTransaction

Active Record Restart Parent Transaction

Inherits From

Public class methods

Source code GitHub
# File activerecord/lib/active_record/connection_adapters/abstract/transaction.rb, line 297
def initialize(connection, parent_transaction, **options)
  super(connection, **options)

  @parent = parent_transaction

  if isolation_level
    raise ActiveRecord::TransactionIsolationError, "cannot set transaction isolation in a nested transaction"
  end

  @parent.state.add_child(@state)
end

Public instance methods

Source code GitHub
# File activerecord/lib/active_record/connection_adapters/abstract/transaction.rb, line 316
def commit
  @state.commit!
end
Source code GitHub
# File activerecord/lib/active_record/connection_adapters/abstract/transaction.rb, line 320
def full_rollback?; false; end
Source code GitHub
# File activerecord/lib/active_record/connection_adapters/abstract/transaction.rb, line 311
def rollback
  @state.rollback!
  @parent.restart
end

Definition files