Globally published models for railway 1.0

This commit is contained in:
Anatoliy Chakkaev 2012-10-30 03:41:45 +04:00
parent e0f5f18774
commit 83695513f9
1 changed files with 3 additions and 0 deletions

View File

@ -172,6 +172,9 @@ function prepareContext(models, railway, app, defSchema, done) {
callback && callback();
m = (schema || defSchema).define(className, _models[cname], settings[cname]);
}
if (global.railway) {
global[cname] = m;
}
return models[cname] = ctx[cname] = m;
};