# File lib/dm-core/associations/one_to_many.rb, line 170 def create(attributes = {}) assert_mutable raise UnsavedParentError, 'You cannot create until the parent is saved' if @parent.new_record? attributes = default_attributes.merge(attributes) resource = children.respond_to?(:create) ? children.create(attributes) : @relationship.child_model.create(attributes) self << resource resource end