Models publishing for both railway stable and unstable

This commit is contained in:
Anatoliy Chakkaev 2012-10-29 22:22:40 +04:00
parent f7aed3a814
commit e0f5f18774
1 changed files with 4 additions and 4 deletions

View File

@ -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,