Merge pull request #198 from anatoliychakkaev/master
Fixed for cs-compound
This commit is contained in:
commit
c882c162c2
16
index.js
16
index.js
|
@ -4,7 +4,12 @@ var path = require('path');
|
||||||
exports.Schema = require('./lib/schema').Schema;
|
exports.Schema = require('./lib/schema').Schema;
|
||||||
exports.AbstractClass = require('./lib/abstract-class').AbstractClass;
|
exports.AbstractClass = require('./lib/abstract-class').AbstractClass;
|
||||||
exports.Validatable = require('./lib/validatable').Validatable;
|
exports.Validatable = require('./lib/validatable').Validatable;
|
||||||
exports.BaseSQL = require('./lib/sql');
|
|
||||||
|
var baseSQL = './lib/sql';
|
||||||
|
|
||||||
|
exports.__defineGetter__('BaseSQL', function () {
|
||||||
|
return require(baseSQL);
|
||||||
|
});
|
||||||
|
|
||||||
exports.init = function (rw) {
|
exports.init = function (rw) {
|
||||||
if (global.railway) {
|
if (global.railway) {
|
||||||
|
@ -12,7 +17,8 @@ exports.init = function (rw) {
|
||||||
} else {
|
} else {
|
||||||
rw.orm = {Schema: exports.Schema, AbstractClass: exports.AbstractClass};
|
rw.orm = {Schema: exports.Schema, AbstractClass: exports.AbstractClass};
|
||||||
}
|
}
|
||||||
require('./lib/railway')(rw);
|
var railway = './lib/railway';
|
||||||
|
require(railway)(rw);
|
||||||
};
|
};
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -23,5 +29,7 @@ try {
|
||||||
}
|
}
|
||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
|
|
||||||
exports.test = require('./test/common_test');
|
var commonTest = './test/common_test';
|
||||||
|
exports.__defineGetter__('test', function () {
|
||||||
|
return require(commonTest);
|
||||||
|
});
|
||||||
|
|
|
@ -11,7 +11,7 @@ if (global.railway) {
|
||||||
module.exports = function init(root) {
|
module.exports = function init(root) {
|
||||||
var railway, app, models;
|
var railway, app, models;
|
||||||
|
|
||||||
if (typeof root !== 'object' || root.constructor.name !== 'Compound') {
|
if (typeof root !== 'object' || (root.constructor.name !== 'Compound' && root.constructor.name !== 'CompoundServer')) {
|
||||||
railway = global.railway;
|
railway = global.railway;
|
||||||
app = global.app;
|
app = global.app;
|
||||||
models = app.models;
|
models = app.models;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "jugglingdb",
|
"name": "jugglingdb",
|
||||||
"description": "ORM for every database: redis, mysql, neo4j, mongodb, couchdb, postgres, sqlite",
|
"description": "ORM for every database: redis, mysql, neo4j, mongodb, couchdb, postgres, sqlite",
|
||||||
"version": "0.2.0-12",
|
"version": "0.2.0-13",
|
||||||
"author": "Anatoliy Chakkaev <rpm1602@gmail.com>",
|
"author": "Anatoliy Chakkaev <rpm1602@gmail.com>",
|
||||||
"contributors": [
|
"contributors": [
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue