From 24a1c76c5968b38d1060b9da9b11b99d1a3dbb09 Mon Sep 17 00:00:00 2001 From: Raymond Feng Date: Mon, 3 Jun 2013 08:51:17 -0700 Subject: [PATCH] Fix the receiver --- lib/datasource.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/datasource.js b/lib/datasource.js index 0401f7ce..d666ab9c 100644 --- a/lib/datasource.js +++ b/lib/datasource.js @@ -774,6 +774,7 @@ DataSource.prototype.discoverSchemasSync = function (owner, tableOrView, options * @param cb */ DataSource.prototype.discoverAndBuildModels = function (owner, tableOrView, options, cb) { + var self = this; this.discoverSchemas(owner, tableOrView, options, function (err, schemas) { if (err) { cb && cb(err, schemas); @@ -785,9 +786,8 @@ DataSource.prototype.discoverAndBuildModels = function (owner, tableOrView, opti var schema = schemas[s]; schemaList.push(schema); } - ; - var models = this.buildModels(schemaList); + var models = self.buildModels(schemaList); cb && cb(err, models); }); }