From da1c8773ff63a89356e39f63048a1792a9420cad Mon Sep 17 00:00:00 2001 From: Alexandre Monjol Date: Tue, 20 Aug 2019 22:30:49 +0200 Subject: [PATCH] [CHORE] Use model name instead of store in isPrimaryType (#6338) * Use model name instead of store in isPrimaryType * Fix property naming error --- packages/serializer/addon/rest.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/serializer/addon/rest.js b/packages/serializer/addon/rest.js index bcb2e2e357a..7f6b71e32f6 100644 --- a/packages/serializer/addon/rest.js +++ b/packages/serializer/addon/rest.js @@ -273,7 +273,7 @@ const RESTSerializer = JSONSerializer.extend({ continue; } - var isPrimary = !forcedSecondary && this.isPrimaryType(store, typeName, primaryModelClass); + var isPrimary = !forcedSecondary && this.isPrimaryType(modelName, primaryModelClass); var value = payload[prop]; if (value === null) { @@ -353,8 +353,8 @@ const RESTSerializer = JSONSerializer.extend({ return documentHash; }, - isPrimaryType(store, typeName, primaryTypeClass) { - return store.modelFor(typeName) === primaryTypeClass; + isPrimaryType(modelName, primaryModelClass) { + return normalizeModelName(modelName) === primaryModelClass.modelName; }, /**