Skip to content

Commit

Permalink
Merge pull request #3937 from bmac/warn-for-mapped-keys
Browse files Browse the repository at this point in the history
[BUGFIX beta] Warn instead of asserting when a mapped key doesn't mat…
  • Loading branch information
bmac committed Nov 17, 2015
2 parents eca7864 + dba1918 commit 272202a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion addon/serializers/json-serializer.js
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,9 @@ export default Serializer.extend({
@return {String} key
*/
_getMappedKey: function(key, modelClass) {
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));
Ember.warn('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), {
id: 'ds.serializer.no-mapped-attrs-key'
});

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

0 comments on commit 272202a

Please sign in to comment.