From a3c347d07342fecef16ed18a76919b56caaf54a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20Bajto=C5=A1?= Date: Thu, 26 Jun 2014 14:53:47 +0200 Subject: [PATCH] compiler: fix references to loopback --- lib/executor.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/executor.js b/lib/executor.js index ba55438..8a238dd 100644 --- a/lib/executor.js +++ b/lib/executor.js @@ -127,7 +127,7 @@ function setupDataSources(app, instructions) { } function setupModels(app, instructions) { - defineModels(instructions); + defineModels(app, instructions); instructions.models.forEach(function(data) { // Skip base models that are not exported to the app @@ -137,20 +137,20 @@ function setupModels(app, instructions) { }); } -function defineModels(instructions) { +function defineModels(app, instructions) { instructions.models.forEach(function(data) { var name = data.name; var model; if (!data.definition) { - model = loopback.getModel(name); + model = app.loopback.getModel(name); if (!model) { throw new Error('Cannot configure unknown model ' + name); } debug('Configuring existing model %s', name); } else { debug('Creating new model %s %j', name, data.definition); - model = loopback.createModel(data.definition); + model = app.loopback.createModel(data.definition); if (data.sourceFile) { debug('Loading customization script %s', data.sourceFile); var code = require(data.sourceFile);