Permalink
Browse files

allow multiple arguments to where

  • Loading branch information...
1 parent 6c47baa commit 23dce93dff65d70449509f4decfc1e655d4efc01 @joeferner committed Oct 26, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/query.js
View
@@ -42,9 +42,9 @@ var Query = function (connection, model) {
Query.prototype.where = function () {
if (typeof (arguments[0]) === 'string') {
var expr = arguments[0];
- var params = arguments[1];
- if (!(params instanceof Array)) {
- params = [ params ];
+ var params = Array.prototype.slice.call(arguments, 1);
+ if (params.length === 1 && params[0] instanceof Array) {
+ params = params[0];
}
this._sqlTree().where.push({expr: expr, params: params});
} else {

0 comments on commit 23dce93

Please sign in to comment.