Skip to content

Commit

Permalink
Merge pull request #4128 from kinesisptyltd/master
Browse files Browse the repository at this point in the history
Fix calls to keyForRelationship in embedded records
  • Loading branch information
bmac committed Feb 1, 2016
2 parents 5990a73 + e9c347a commit 8f6160c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions addon/-private/serializers/embedded-records-mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ export default Ember.Mixin.create({

_serializeEmbeddedBelongsTo(snapshot, json, relationship) {
let embeddedSnapshot = snapshot.belongsTo(relationship.key);
let serializedKey = this.keyForRelationship(relationship.key, 'serialize');
let serializedKey = this.keyForRelationship(relationship.key, relationship.kind, 'serialize');
if (!embeddedSnapshot) {
json[serializedKey] = null;
} else {
Expand Down Expand Up @@ -332,7 +332,7 @@ export default Ember.Mixin.create({
},

_serializeEmbeddedHasMany(snapshot, json, relationship) {
let serializedKey = this.keyForRelationship(relationship.key, 'serialize');
let serializedKey = this.keyForRelationship(relationship.key, relationship.kind, 'serialize');

warn(
`The embedded relationship '${serializedKey}' is undefined for '${snapshot.modelName}' with id '${snapshot.id}'. Please include it in your original payload.`,
Expand Down

0 comments on commit 8f6160c

Please sign in to comment.