method
create_record
v2.1.0 -
Show latest stable
- Class:
ActiveRecord::Associations::HasAndBelongsToManyAssociation
create_record(attributes, &block)private
No documentation available.
# File activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb, line 101
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