Skip to content

Commit

Permalink
Revert "[CHORE] Use model name instead of store in isPrimaryType (#6338
Browse files Browse the repository at this point in the history
…)"

This reverts commit a33d8ea.
  • Loading branch information
runspired authored Aug 20, 2019
1 parent a33d8ea commit 3e60495
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/serializer/addon/rest.js
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ const RESTSerializer = JSONSerializer.extend({
continue;
}

var isPrimary = !forcedSecondary && this.isPrimaryType(modelName, primaryModelClass);
var isPrimary = !forcedSecondary && this.isPrimaryType(store, typeName, primaryModelClass);
var value = payload[prop];

if (value === null) {
Expand Down Expand Up @@ -351,8 +351,8 @@ const RESTSerializer = JSONSerializer.extend({
return documentHash;
},

isPrimaryType(modelName, primaryModelClass) {
return normalizeModelName(modelName) === primaryModelClass.modelName;
isPrimaryType(store, typeName, primaryTypeClass) {
return store.modelFor(typeName) === primaryTypeClass;
},

/**
Expand Down

0 comments on commit 3e60495

Please sign in to comment.