Skip to content

Commit

Permalink
Fix #4366: EmbeddedRecordsMixin embeds the record, not the snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
Danail Nachev committed May 8, 2016
1 parent 2001ee3 commit 8b84ab0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions addon/serializers/embedded-records-mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ export default Ember.Mixin.create({
if (!embeddedSnapshot) {
json[serializedKey] = null;
} else {
json[serializedKey] = embeddedSnapshot.record.serialize({ includeId: true });
json[serializedKey] = embeddedSnapshot.serialize({ includeId: true });
this.removeEmbeddedForeignKey(snapshot, embeddedSnapshot, relationship, json[serializedKey]);

if (relationship.options.polymorphic) {
Expand Down Expand Up @@ -440,7 +440,7 @@ export default Ember.Mixin.create({

for (let i = 0; i < manyArray.length; i++) {
let embeddedSnapshot = manyArray[i];
let embeddedJson = embeddedSnapshot.record.serialize({ includeId: true });
let embeddedJson = embeddedSnapshot.serialize({ includeId: true });
this.removeEmbeddedForeignKey(snapshot, embeddedSnapshot, relationship, embeddedJson);
ret[i] = embeddedJson;
}
Expand Down

0 comments on commit 8b84ab0

Please sign in to comment.