From 9d3ab6fc42b8d43f7c01a229279666f95aa4b3b1 Mon Sep 17 00:00:00 2001 From: Geoffroy Lesage Date: Thu, 8 Jan 2015 10:29:55 -0600 Subject: [PATCH] Fixed isActual syntax to accept optional model arg --- lib/mysql.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/mysql.js b/lib/mysql.js index 4dde58e..a9c32fe 100644 --- a/lib/mysql.js +++ b/lib/mysql.js @@ -693,7 +693,18 @@ MySQL.prototype.createTable = function (model, cb) { */ MySQL.prototype.isActual = function(models, cb) { var self = this; - var ok = false; + + if ((!cb) && ('function' === typeof models)) { + cb = models; + models = undefined; + } + // First argument is a model name + if ('string' === typeof models) { + models = [models]; + } + + models = models || Object.keys(this._models); + async.each(Object.keys(models), function(model, done) { var table = self.tableEscaped(model); self.query('SHOW FIELDS FROM ' + table, function(err, fields) {