Permalink
Browse files

Initializer for compound 1.1.5-16

  • Loading branch information...
1602 committed Mar 11, 2013
1 parent 8ca6d2e commit 6f1c9b20344554c9d024c75f45bbfd8cafb371d2
Showing with 13 additions and 4 deletions.
  1. +13 −4 index.js
View
@@ -18,10 +18,19 @@ exports.init = function (rw) {
rw.orm = {Schema: exports.Schema, AbstractClass: exports.AbstractClass};
}
var railway = './lib/railway';
- try {
- var init = require(railway);
- } catch (e) {}
- if (init) init(rw);
+
+ if (rw.version > '1.1.5-15') {
+ rw.on('after routes', initialize);
+ } else {
+ initialize();
+ }
+
+ function initialize() {
+ try {
+ var init = require(railway);
+ } catch (e) {}
+ if (init) init(rw);
+ }
};
exports.__defineGetter__('version', function () {

0 comments on commit 6f1c9b2

Please sign in to comment.