Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Raymond Feng committed May 20, 2015
1 parent 5815e79 commit a62e06d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/sql.js
Expand Up @@ -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]]));
Expand Down Expand Up @@ -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];
Expand Down

0 comments on commit a62e06d

Please sign in to comment.