dresende/node-orm2 — pull request #189 by agaman (2013-06-07 18:57:49+00:00)
Title: Allow db.load() to work outside of module.exports

As it works now, db.load() will load models correctly from a call at the highest level of a script, or from within module.exports, but not from an arbitrary function. This change aims to correct behavior:

Before:

```javascript```
MyObj.prototype.initDB = function() {
this.db.load("./model", function(err) {
console.log(err);
});
console.log(this.db.models);
};

{ [Error: Cannot find module '//./model'] code: 'MODULE_NOT_FOUND' }
{}
```

After:

```javascript```
MyObj.prototype.initDB = function() {
this.db.load("./model", function(err) {
console.log(err);
});
console.log(this.db.models);
};

undefined
{}
```