-
Notifications
You must be signed in to change notification settings - Fork 369
Closed
Description
File: ORM.js
Function: ORM.prototype.load
Issue:
Function load does not return any value when it is success. It is OK when model is loaded with instance of connect function. However, it has some problem using with express function.
In below code, novalue has undefined, because the load function doesn't return. It results in work-around code such as models.user = db.models.user;.
However, it'd be better that models.user = db.load ....
exports.db = orm.express(options, {
define: function (db, models) {
var novalue = db.load('./models/user', function (err) {
if (err) {
console.log('Fail to load model');
throw err;
}
return db.models.user; /* HAVE NO EFFECT */
});
models.user = db.models.user;
}
});Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels