diff --git a/models/Relationships/HasOneOrMany.cfc b/models/Relationships/HasOneOrMany.cfc index 3698003..cb27e26 100644 --- a/models/Relationships/HasOneOrMany.cfc +++ b/models/Relationships/HasOneOrMany.cfc @@ -321,9 +321,20 @@ component * @return quick.models.BaseEntity */ public any function create( struct attributes = {} ) { - var newInstance = variables.related.newEntity().fill( arguments.attributes ); + return newEntity() + .fill( arguments.attributes ) + .save(); + } + + /** + * Returns a new instance of the entity, pre-associated to the parent entity. Does not persist it. + * + * @return quick.models.BaseEntity + */ + public any function newEntity() { + var newInstance = variables.related.newEntity(); setForeignAttributesForCreate( newInstance ); - return newInstance.save(); + return newInstance; } /**