method
_create_record
v6.1.7.7 -
Show latest stable
- Class:
ActiveRecord::Associations::SingularAssociation
_create_record(attributes, raise_error = false, &block)private
No documentation available.
# File activerecord/lib/active_record/associations/singular_association.rb, line 50
def _create_record(attributes, raise_error = false, &block)
record = build_record(attributes, &block)
saved = record.save
set_new_record(record)
raise RecordInvalid.new(record) if !saved && raise_error
record
end