# class ActiveRecord::ConnectionAdapters::TransactionState

### Constants

VALID_STATES

### Public Class Methods

new(state = nil) click to toggle source

    # File lib/active_record/connection_adapters/abstract/transaction.rb, line 6
    def initialize(state = nil)
      @state = state
    end

### Public Instance Methods

committed?() click to toggle source

    # File lib/active_record/connection_adapters/abstract/transaction.rb, line 14
    def committed?
      @state == :committed
    end

completed?() click to toggle source

    # File lib/active_record/connection_adapters/abstract/transaction.rb, line 22
    def completed?
      committed? || rolledback?
    end

finalized?() click to toggle source

    # File lib/active_record/connection_adapters/abstract/transaction.rb, line 10
    def finalized?
      @state
    end

rolledback?() click to toggle source

    # File lib/active_record/connection_adapters/abstract/transaction.rb, line 18
    def rolledback?
      @state == :rolledback
    end

set_state(state) click to toggle source

    # File lib/active_record/connection_adapters/abstract/transaction.rb, line 26
    def set_state(state)
      unless VALID_STATES.include?(state)
        raise ArgumentError, "Invalid transaction state: #{state}"
      end
      @state = state
    end