method

before_commit_records

Importance_0
Ruby on Rails latest stable (v7.1.3.2) - 0 notes - Class: Transaction
before_commit_records() public

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activerecord/lib/active_record/connection_adapters/abstract/transaction.rb, line 208
      def before_commit_records
        return unless records

        if @run_commit_callbacks
          if ActiveRecord.before_committed_on_all_records
            ite = unique_records

            instances_to_run_callbacks_on = records.each_with_object({}) do |record, candidates|
              candidates[record] = record
            end

            run_action_on_records(ite, instances_to_run_callbacks_on) do |record, should_run_callbacks|
              record.before_committed! if should_run_callbacks
            end
          else
            records.uniq.each(&:before_committed!)
          end
        end
      end
Register or log in to add new notes.