class ActiveRecord::ConnectionAdapters::TransactionState

Active Record Connection Adapters Transaction State

def add_child(state)

def add_child(state)
  @children ||= []
  @children << state
end

def commit!

def commit!
  @state = :committed
end

def committed?

def committed?
  @state == :committed || @state == :fully_committed
end

def completed?

def completed?
  committed? || rolledback?
end

def finalized?

def finalized?
  @state
end

def full_commit!

def full_commit!
  @state = :fully_committed
end

def full_rollback!

def full_rollback!
  @children&.each { |c| c.rollback! }
  @state = :fully_rolledback
end

def fully_committed?

def fully_committed?
  @state == :fully_committed
end

def fully_completed?

def fully_completed?
  completed?
end

def fully_rolledback?

def fully_rolledback?
  @state == :fully_rolledback
end

def initialize(state = nil)

def initialize(state = nil)
  @state = state
  @children = nil
end

def invalidate!

def invalidate!
  @children&.each { |c| c.invalidate! }
  @state = :invalidated
end

def invalidated?

def invalidated?
  @state == :invalidated
end

def nullify!

def nullify!
  @state = nil
end

def rollback!

def rollback!
  @children&.each { |c| c.rollback! }
  @state = :rolledback
end

def rolledback?

def rolledback?
  @state == :rolledback || @state == :fully_rolledback
end