method
create_record
Ruby on Rails latest stable (v7.1.3.2)
-
0 notes -
Class: ActiveRecord::Associations::HasAndBelongsToManyAssociation
create_record(attributes, &block)
private
Hide source
# File activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb, line 124 def create_record(attributes, &block) # Can't use Base.create because the foreign key may be a protected attribute. ensure_owner_is_not_new if attributes.is_a?(Array) attributes.collect { |attr| create(attr) } else build_record(attributes, &block) end end