From a9bf43752f0f0d1743d966eb1649376b76cfc7dc Mon Sep 17 00:00:00 2001 From: biniam Date: Tue, 11 Sep 2018 15:41:33 -0400 Subject: [PATCH] fixup! apply feedback --- lib/sql.js | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/lib/sql.js b/lib/sql.js index 8903d00..0b7fc85 100644 --- a/lib/sql.js +++ b/lib/sql.js @@ -1097,19 +1097,11 @@ SQLConnector.prototype._buildWhere = function(model, where) { // The value is not an array, fall back to regular fields } - if (key === 'where') { - // business as usual if the model has a property named 'where' - if (props[key]) { - continue; - } else { - throw new Error('Filter object detected. Please use a where object instead.'); - } - } var p = props[key]; if (p == null) { - // Unknown property, ignore it - debug('Unknown property %s is skipped for model %s', key, model); - continue; + throw new Error( + `Unknown property ${key} used in a "where" condition for model ${model}` + ); } // eslint-disable one-var var expression = where[key];