We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
From https://github.com/emberjs/data/blob/v2.1.0/packages/ember-data/lib/system/relationships/state/relationship.js#: setHasData:
/*All relationships for a newly created ('store.createRecord()') are considered known ('hasData === true'). */
=> serializeHasMany:
serializeHasMany: function(snapshot, json, relationship) { //.. //json[payloadKey] = snapshot.hasMany(key, { ids: true }); var onlyNotNew=snapshot.hasMany(key); if (onlyNotNew) { onlyNotNew=onlyNotNew .filter(function(rel){return !rel.get("isNew");}) .map(function(rel){return rel.id;}); } json[payloadKey] = onlyNotNew || []; //.. }
serializeBelongsTo:
serializeBelongsTo: function(snapshot, json, relationship) { var key = relationship.key; var onlyNotNew=snapshot.belongsTo(key); if (onlyNotNew) { if (!onlyNotNew.get("isNew")) { onlyNotNew=onlyNotNew.id; } else { onlyNotNew=null; } } var belongsToId = onlyNotNew; var payloadKey = this._getMappedKey(key); if (payloadKey === key && this.keyForRelationship) { payloadKey = this.keyForRelationship(key, "belongsTo"); } if (Ember.isNone(belongsToId)) { json[payloadKey] = null; } else { json[payloadKey] = belongsToId; } if (relationship.options.polymorphic) { this.serializePolymorphicType(snapshot, json, relationship); } } },
The text was updated successfully, but these errors were encountered:
No branches or pull requests
From https://github.com/emberjs/data/blob/v2.1.0/packages/ember-data/lib/system/relationships/state/relationship.js#: setHasData:
=> serializeHasMany:
serializeBelongsTo:
The text was updated successfully, but these errors were encountered: