instance method transaction_include_any_action?

Ruby on Rails edge

Since edge Private — implementation detail, not part of the public API

Signature

transaction_include_any_action?(actions)

Determine if a transaction included an action for :create, :update, or :destroy. Used in filtering callbacks.

Parameters

actions req
Source
# File activerecord/lib/active_record/transactions.rb, line 545
      def transaction_include_any_action?(actions)
        actions.any? do |action|
          case action
          when :create
            persisted? && @_new_record_before_last_commit
          when :update
            !(@_new_record_before_last_commit || destroyed?) && _trigger_update_callback
          when :destroy
            _trigger_destroy_callback
          end
        end
      end

Defined in activerecord/lib/active_record/transactions.rb line 545 · 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