From dbc41732409f89d8f3f69db180291c306ea06b65 Mon Sep 17 00:00:00 2001 From: wubzz Date: Thu, 26 May 2016 09:02:30 +0200 Subject: [PATCH] Any binding that is an object/class containing the function .toSQL must be processed as an Array in Raw's toSQL. --- src/raw.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/raw.js b/src/raw.js index cd23079829..591b41e6cb 100644 --- a/src/raw.js +++ b/src/raw.js @@ -25,7 +25,7 @@ assign(Raw.prototype, { set(sql, bindings) { this._cached = undefined this.sql = sql - this.bindings = (isObject(bindings) || isUndefined(bindings)) ? bindings : [bindings] + this.bindings = ((isObject(bindings) && !bindings.toSQL) || isUndefined(bindings)) ? bindings : [bindings] return this },