Skip to content

Commit

Permalink
[BUGFIX release] Fix for breaking RESTSerializer test
Browse files Browse the repository at this point in the history
  • Loading branch information
fsmanuel committed Nov 10, 2015
1 parent 7ea8251 commit 34e97d0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/ember-data/lib/serializers/json-serializer.js
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,13 @@ export default Serializer.extend({
if (!hash.hasOwnProperty(payloadKey)) { continue; }

// we need to normalize for JSONAPISerializer
normalizedKey = this.keyForAttribute(key);
if (get(modelClass, 'attributes').has(key)) {
normalizedKey = this.keyForAttribute(key);
}

if (get(modelClass, 'relationshipsByName').has(key)) {
normalizedKey = this.keyForRelationship(key);
}

if (payloadKey !== normalizedKey) {
hash[normalizedKey] = hash[payloadKey];
Expand Down

0 comments on commit 34e97d0

Please sign in to comment.