From 8b84ab05789f909c67928cac5a63b9f42609fd86 Mon Sep 17 00:00:00 2001 From: Danail Nachev Date: Sun, 8 May 2016 12:53:01 -0700 Subject: [PATCH] Fix #4366: EmbeddedRecordsMixin embeds the record, not the snapshot --- addon/serializers/embedded-records-mixin.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addon/serializers/embedded-records-mixin.js b/addon/serializers/embedded-records-mixin.js index 32ff71fe03a..cfdd86a9430 100644 --- a/addon/serializers/embedded-records-mixin.js +++ b/addon/serializers/embedded-records-mixin.js @@ -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) { @@ -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; }