Skip to content

Commit

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

* Fix property naming error
  • Loading branch information
Alexandre Monjol authored and Gaurav0 committed Dec 2, 2019
1 parent 3b4dcda commit da1c877
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(store, typeName, primaryModelClass);
var isPrimary = !forcedSecondary && this.isPrimaryType(modelName, primaryModelClass);
var value = payload[prop];

if (value === null) {
Expand Down Expand Up @@ -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;
},

/**
Expand Down

0 comments on commit da1c877

Please sign in to comment.