class ActiveRecord::ConnectionAdapters::TransactionState - activerecord-4.2.4 Documentation

# class ActiveRecord::ConnectionAdapters::TransactionState

### Constants

VALID_STATES

### Attributes

parent[R]

### Public Class Methods

new(state = nil) click to toggle source

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

### Public Instance Methods

committed?() click to toggle source

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

completed?() click to toggle source

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

finalized?() click to toggle source

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

rolledback?() click to toggle source

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

set_state(state) click to toggle source

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