Fix to handle new isNewRecord implementation

This commit is contained in:
Fabien Franzen 2014-09-13 00:03:08 +02:00
parent 3655107334
commit 7f155966ab
1 changed files with 6 additions and 1 deletions

View File

@ -2020,7 +2020,12 @@ EmbedsMany.prototype.prepareEmbeddedInstance = function(inst) {
var self = this;
var propertyName = this.definition.keyFrom;
var modelInstance = this.modelInstance;
inst.__persisted = true;
if (this.definition.options.persistent) {
var pk = this.definition.keyTo;
inst.__persisted = !!inst[pk];
} else {
inst.__persisted = true;
}
inst.triggerParent = function(actionName, callback) {
if (actionName === 'save' || actionName === 'destroy') {
var embeddedList = self.embeddedList();