fixup! apply feedback

This commit is contained in:
biniam 2018-09-11 15:41:33 -04:00
parent e1cc0d70a9
commit a9bf43752f
1 changed files with 3 additions and 11 deletions

View File

@ -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];