instance method bulk_write

Ruby on Rails edge

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

Signature

bulk_write(method)

No documentation comment.

Parameters

method req
Source
# File activerecord/lib/active_record/associations/collection_proxy.rb, line 1270
        def bulk_write(method)
          if @association&.target&.any? { |r| r.new_record? }
            association_name = @association.reflection.name
            ActiveRecord.deprecator.warn(<<~MSG)
              Using #{method} on association #{association_name} with unpersisted records
              is deprecated and will be removed in Rails 8.2.
              The unpersisted records will be lost after this operation.
              Please either persist your records first or store them separately before
              calling #{method}.
            MSG
            yield
          else
            yield.tap { reset }
          end
        end

Defined in activerecord/lib/active_record/associations/collection_proxy.rb line 1270 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveRecord::Associations::CollectionProxy

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