From e0f5f187747d7a03caaa7c6cb6e0ea3d35384be3 Mon Sep 17 00:00:00 2001 From: Anatoliy Chakkaev Date: Mon, 29 Oct 2012 22:22:40 +0400 Subject: [PATCH] Models publishing for both railway stable and unstable --- lib/railway.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/railway.js b/lib/railway.js index 172ba051..a0138724 100644 --- a/lib/railway.js +++ b/lib/railway.js @@ -52,7 +52,7 @@ module.exports = function init(root) { schema.log = log; railway.orm._schemas.push(schema); -var context = prepareContext(railway, app, schema); +var context = prepareContext(models, railway, app, schema); // run schema first var schemaFile = (root || app.root) + '/db/schema.'; @@ -65,7 +65,7 @@ if (existsSync(schemaFile + 'js')) { } if (schemaFile) { - var code = fs.readFileSync(schemaFile); + var code = fs.readFileSync(schemaFile).toString(); if (schemaFile.match(/\.coffee$/)) { code = require('coffee-script').compile(code); } @@ -104,9 +104,9 @@ function log(str, startTime) { }); } -function prepareContext(railway, app, defSchema, done) { +function prepareContext(models, railway, app, defSchema, done) { var ctx = {app: app}, - models = {}, + _models = {}, settings = {}, cname, schema,