Skip to content

Commit

Permalink
Merge pull request #3396 from jcope2013/master
Browse files Browse the repository at this point in the history
make sure deprecate error doesnt get swallowed when using store.push(type, data)
  • Loading branch information
wecc committed Jun 19, 2015
2 parents 2af2e4e + e1daa63 commit 84bffcb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/ember-data/lib/system/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -1773,11 +1773,11 @@ Store = Service.extend({
if (Ember.typeOf(modelNameArg) === 'object' && Ember.typeOf(dataArg) === 'undefined') {
data = modelNameArg;
} else {
Ember.deprecate('store.push(type, data) has been deprecated. Please provide a JSON-API document object as the first and only argument to store.push.');
Ember.assert("Expected an object as `data` in a call to `push` for " + modelNameArg + " , but was " + Ember.typeOf(dataArg), Ember.typeOf(dataArg) === 'object');
Ember.assert("You must include an `id` for " + modelNameArg + " in an object passed to `push`", dataArg.id != null && dataArg.id !== '');
data = _normalizeSerializerPayload(this.modelFor(modelNameArg), dataArg);
modelName = modelNameArg;
Ember.deprecate('store.push(type, data) has been deprecated. Please provide a JSON-API document object as the first and only argument to store.push.');
Ember.assert('Passing classes to store methods has been removed. Please pass a dasherized string instead of '+ Ember.inspect(modelName), typeof modelName === 'string' || typeof data === 'undefined');
}

Expand Down

0 comments on commit 84bffcb

Please sign in to comment.