Merge pull request #198 from anatoliychakkaev/master

Fixed for cs-compound
This commit is contained in:
Anatoliy Chakkaev 2013-01-22 08:29:47 -08:00
commit c882c162c2
3 changed files with 14 additions and 6 deletions

View File

@ -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);
});

View File

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

View File

@ -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": [
{ {