diff --git a/lib/dao.js b/lib/dao.js index f8e4431b..c4236a91 100644 --- a/lib/dao.js +++ b/lib/dao.js @@ -931,7 +931,7 @@ DataAccessObject.prototype.save = function (options, callback) { var data = inst.toObject(true); var modelName = Model.modelName; - if (!getIdValue(Model, this)) { + if (this.isNewRecord()) { return Model.create(this, callback); } diff --git a/lib/relation-definition.js b/lib/relation-definition.js index 3a5b7371..143e381b 100644 --- a/lib/relation-definition.js +++ b/lib/relation-definition.js @@ -1968,6 +1968,7 @@ EmbedsMany.prototype.prepareEmbeddedInstance = function(inst) { var self = this; var propertyName = this.definition.keyFrom; var modelInstance = this.modelInstance; + inst.__persisted = true; inst.triggerParent = function(actionName, callback) { if (actionName === 'save' || actionName === 'destroy') { var embeddedList = self.embeddedList();