From 56a37b5938c48c1d615ae0ee43b853fe5fff8cef Mon Sep 17 00:00:00 2001 From: Ryan Toronto Date: Wed, 31 Jan 2018 10:28:58 -0500 Subject: [PATCH] Check if adapter#query is a wrapped function --- addon/-private/system/store/finders.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/addon/-private/system/store/finders.js b/addon/-private/system/store/finders.js index 0103a0084a1..ed3f8416f06 100644 --- a/addon/-private/system/store/finders.js +++ b/addon/-private/system/store/finders.js @@ -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 = adapter.query(store, modelClass, query, recordArray); } else {