fixup! apply feedback
This commit is contained in:
parent
e1cc0d70a9
commit
a9bf43752f
14
lib/sql.js
14
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];
|
||||
|
|
Loading…
Reference in New Issue