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