MongoDB
 sql >> Base de données >  >> NoSQL >> MongoDB

Hiérarchie à plusieurs niveaux des données Ember avec toujours intégré

Il reste encore quelques corrections de bogues dans les rails de braise :Nous avons souffert à cause de la fonction

extractEmbeddedBelongsTo: function(loader, relationship, data, parent, prematerialized)     {
var reference = this.extractRecordRepresentation(loader, relationship.type, data, true);
prematerialized[relationship.key] = reference;

// If the embedded record should also be saved back when serializing the parent,
// make sure we set its parent since it will not have an ID.
var embeddedType = this.embeddedType(parent.type, relationship.key);
if (embeddedType === 'always') {
  reference.parent = parent;
}

}

La relation BelongsTo ignore l'extraction des objets incorporés. Le mauvais est ici :

extractEmbeddedBelongsTo: function(loader, relationship, data, parent, prematerialized) {
var reference = loader.sideload(relationship.type, data);
prematerialized[relationship.key] = reference;

// If the embedded record should also be saved back when serializing the parent,
// make sure we set its parent since it will not have an ID.
var embeddedType = this.embeddedType(parent.type, relationship.key);
if (embeddedType === 'always') {
  reference.parent = parent;
}

}