From 8360576c40f6ec3425ff2d1b303dccfde8670006 Mon Sep 17 00:00:00 2001 From: Raymond Feng Date: Wed, 4 Dec 2013 15:24:53 -0800 Subject: [PATCH] Attach models to the data source --- lib/datasource.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/datasource.js b/lib/datasource.js index dda360e9..62e1a688 100644 --- a/lib/datasource.js +++ b/lib/datasource.js @@ -1241,6 +1241,10 @@ DataSource.prototype.discoverAndBuildModels = function (modelName, options, cb) } var models = self.modelBuilder.buildModels(schemaList); + // Now attach the models to the data source + for(var m in models) { + models[m].attachTo(self); + } cb && cb(err, models); }); };