instance method remember_transaction_record_state

Ruby on Rails edge

Since v3.0.20 Private — implementation detail, not part of the public API

Available in: v3.0.20 v3.1.12 edge

Signature

remember_transaction_record_state()

Save the new record state and id of a record so it can be restored later if a transaction fails.

Source
# File activerecord/lib/active_record/transactions.rb, line 466
      def remember_transaction_record_state
        @_start_transaction_state ||= {
          id: id,
          new_record: @new_record,
          previously_new_record: @previously_new_record,
          destroyed: @destroyed,
          attributes: @attributes,
          frozen?: frozen?,
          level: 0
        }
        @_start_transaction_state[:level] += 1

        if _committed_already_called
          @_new_record_before_last_commit = false
        else
          @_new_record_before_last_commit = @_start_transaction_state[:new_record]
        end
      end

Defined in activerecord/lib/active_record/transactions.rb line 466 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveRecord::Transactions

Type at least 2 characters to search.

Use the arrow keys to navigate results, Enter to open one, Escape to close.

Keyboard shortcuts

/
Focus search
⌘K / Ctrl-K
Command palette
?
This help
Esc
Close