Skip to content

Commit

Permalink
deprecate old private method rather than deleting
Browse files Browse the repository at this point in the history
  • Loading branch information
Gaurav0 committed Dec 2, 2019
1 parent 57da617 commit be14e5f
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 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(typeName, primaryModelClass);
var isPrimary = !forcedSecondary && this._isPrimaryModelName(typeName, primaryModelClass);
var value = payload[prop];

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

isPrimaryType(modelName, primaryModelClass) {
isPrimaryType(store, typeName, primaryTypeClass) {
deprecate('isPrimaryType is deprecated.', true, {
id: 'ds.serializer.rest.is-primary-type',
until: '3.17',
});
return store.modelFor(typeName) === primaryTypeClass;
},

_isPrimaryModelName(modelName, primaryModelClass) {
return normalizeModelName(modelName) === primaryModelClass.modelName;
},

Expand Down

0 comments on commit be14e5f

Please sign in to comment.