Skip to content

Commit

Permalink
[BUGFIX release] Revert pr #3864
Browse files Browse the repository at this point in the history
The origial intent was for a queryRecord with no response to reject the promise so it would act like a `findRecord` with a 404. This change introduced a regression that broke existing apps so it is going to be reverted.

Closes #4219

(cherry picked from commit 274d7b1)
  • Loading branch information
bmac committed Mar 22, 2016
1 parent 06749ab commit f0e8414
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 13 deletions.
1 change: 0 additions & 1 deletion addon/-private/system/store/finders.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,6 @@ export function _queryRecord(adapter, store, typeClass, query) {
var record;
store._adapterRun(function() {
var payload = normalizeResponseHelper(serializer, store, typeClass, adapterPayload, null, 'queryRecord');
Ember.assert('`store.queryRecord` expected the adapter to return one record but the response from the adapter was empty.', payload.data);
//TODO Optimize
record = store.push(payload);
});
Expand Down
12 changes: 0 additions & 12 deletions tests/integration/adapter/rest-adapter-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1330,18 +1330,6 @@ test("queryRecord - returning an array picks the first one but saves all records
}));
});

test("queryRecord - returning an empty array errors", function(assert) {
ajaxResponse({
post: []
});

assert.expectAssertion(function() {
Ember.run(function() {
store.queryRecord('post', { slug: 'rails-is-omakaze' });
});
}, /`store.queryRecord` expected the adapter to return one record/);
});

test("queryRecord - data is normalized through custom serializers", function(assert) {
env.registry.register('serializer:post', DS.RESTSerializer.extend({
primaryKey: '_ID_',
Expand Down

0 comments on commit f0e8414

Please sign in to comment.