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
|
// 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];
|
var p = props[key];
|
||||||
if (p == null) {
|
if (p == null) {
|
||||||
// Unknown property, ignore it
|
throw new Error(
|
||||||
debug('Unknown property %s is skipped for model %s', key, model);
|
`Unknown property ${key} used in a "where" condition for model ${model}`
|
||||||
continue;
|
);
|
||||||
}
|
}
|
||||||
// eslint-disable one-var
|
// eslint-disable one-var
|
||||||
var expression = where[key];
|
var expression = where[key];
|
||||||
|
|
Loading…
Reference in New Issue