Merge pull request #300 from fabien/fix/embeds-many

Fix to handle new isNewRecord implementation
This commit is contained in:
Raymond Feng 2014-09-12 15:26:57 -07:00
commit dd887426ed
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();