Skip to content

Commit

Permalink
Merge pull request #5345 from ryanto/check-wrapped-function
Browse files Browse the repository at this point in the history
Check if adapter#query is a wrapped function
  • Loading branch information
runspired authored Mar 28, 2018
2 parents fe685f6 + 56a37b5 commit 9875086
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion addon/-private/system/store/finders.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,10 @@ export function _query(adapter, store, modelName, query, recordArray) {
let modelClass = store.modelFor(modelName); // adapter.query needs the class

let promise;
if (adapter.query.length > 3) {
let createRecordArray = adapter.query.length > 3 ||
(adapter.query.wrappedFunction && adapter.query.wrappedFunction.length > 3);

if (createRecordArray) {
recordArray = recordArray || store.recordArrayManager.createAdapterPopulatedRecordArray(modelName, query);
promise = Promise.resolve().then(() => adapter.query(store, modelClass, query, recordArray));
} else {
Expand Down

0 comments on commit 9875086

Please sign in to comment.