instance method
bulk_write
Ruby on Rails edge
Since edge Private — implementation detail, not part of the public APISignature
bulk_write(method)
No documentation comment.
Parameters
-
methodreq
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