Skip to content

Commit

Permalink
[BUGFIX release] Move check into assert
Browse files Browse the repository at this point in the history
  • Loading branch information
fsmanuel committed Nov 11, 2015
1 parent 34e97d0 commit 3a84960
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions packages/ember-data/lib/serializers/json-serializer.js
Original file line number Diff line number Diff line change
Expand Up @@ -760,10 +760,7 @@ export default Serializer.extend({
@return {String} key
*/
_getMappedKey: function(key, modelClass) {
const hasAttributeKey = get(modelClass, 'attributes').has(key);
const hasRelationshipKey = get(modelClass, 'relationshipsByName').has(key);

Ember.assert('There is no attribute or relationship with the name `' + key + '` on `' + modelClass.modelName + '`. Check your serializers attrs hash.', hasAttributeKey || hasRelationshipKey);
Ember.assert('There is no attribute or relationship with the name `' + key + '` on `' + modelClass.modelName + '`. Check your serializers attrs hash.', get(modelClass, 'attributes').has(key) || get(modelClass, 'relationshipsByName').has(key));

var attrs = get(this, 'attrs');
var mappedKey;
Expand Down

0 comments on commit 3a84960

Please sign in to comment.