method
create
Ruby on Rails latest stable (v7.1.3.2)
-
0 notes -
Class: ActiveRecord::Associations::AssociationCollection
create(attrs = {})
public
Hide source
# File activerecord/lib/active_record/associations/association_collection.rb, line 267 def create(attrs = {}) if attrs.is_a?(Array) attrs.collect { |attr| create(attr) } else create_record(attrs) do |record| yield(record) if block_given? record.save end end end