Skip to content

Commit

Permalink
Merge pull request #4191 from asakusuma/opt-push-internal
Browse files Browse the repository at this point in the history
Don't resolve model name unless actually needed
  • Loading branch information
krisselden committed Feb 27, 2016
2 parents a77a406 + 08f25dc commit 9a8733b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions addon/-private/system/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -1674,12 +1674,11 @@ Store = Service.extend({
assert(`You must include an 'id' for ${modelName} in an object passed to 'push'`, data.id != null && data.id !== '');
assert(`You tried to push data with a type '${modelName}' but no model could be found with that name.`, this._hasModelFor(modelName));

var type = this.modelFor(modelName);

// If Ember.ENV.DS_WARN_ON_UNKNOWN_KEYS is set to true and the payload
// contains unknown keys, log a warning.

if (Ember.ENV.DS_WARN_ON_UNKNOWN_KEYS) {
var type = this.modelFor(modelName);
warn("The payload for '" + type.modelName + "' contains these unknown keys: " +
Ember.inspect(Object.keys(data).forEach((key) => {
return !(key === 'id' || key === 'links' || get(type, 'fields').has(key) || key.match(/Type$/));
Expand Down

0 comments on commit 9a8733b

Please sign in to comment.