Raymond Feng 2015-05-20 09:20:35 -07:00
parent 5815e79395
commit a62e06d367
1 changed files with 2 additions and 3 deletions

View File

@ -639,7 +639,7 @@ SQLConnector.prototype.buildExpression = function(columnName, operator, columnVa
function buildClause(columnValue, separator, grouping) {
var values = [];
for (var i = 0, n = columnValue.length; i < n; i++) {
if (columnValue instanceof ParameterizedSQL) {
if (columnValue[i] instanceof ParameterizedSQL) {
values.push(columnValue[i]);
} else {
values.push(new ParameterizedSQL(PLACEHOLDER, [columnValue[i]]));
@ -749,8 +749,7 @@ SQLConnector.prototype._buildWhere = function(model, where) {
var sqlExp;
if (expression === null || expression === undefined) {
stmt.merge(columnName + ' IS NULL');
} else if (expression &&
(typeof expression === 'object' && !Array.isArray(expression))) {
} else if (expression && expression.constructor === Object) {
var operator = Object.keys(expression)[0];
// Get the expression without the operator
expression = expression[operator];