Skip to content

Commit

Permalink
Merge pull request #3347 from wecc/json-serializer-fix
Browse files Browse the repository at this point in the history
Implement modelNameFromPayloadKey in JSONSerializer
  • Loading branch information
fivetanley committed Jun 16, 2015
2 parents 900d378 + 83994f8 commit 517c4e3
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions packages/ember-data/lib/serializers/json-serializer.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import Serializer from "ember-data/system/serializer";
import coerceId from "ember-data/system/coerce-id";
import normalizeModelName from "ember-data/system/normalize-model-name";

var get = Ember.get;
var isNone = Ember.isNone;
Expand Down Expand Up @@ -607,6 +608,16 @@ var JSONSerializer = Serializer.extend({
return relationships;
},

/**
@method modelNameFromPayloadKey
@param {String} key
@return {String} the model's modelName
*/
modelNameFromPayloadKey: function(key) {
return normalizeModelName(key);
},


/**
You can use this method to normalize all payloads, regardless of whether they
represent single records or an array.
Expand Down

0 comments on commit 517c4e3

Please sign in to comment.