1. Error logging. 2. Options argument of model's include function to pass filter.where object.
This commit is contained in:
parent
286ead05af
commit
ac52394746
|
@ -406,6 +406,10 @@ SQLConnector.prototype.execute = function(sql, params, options, callback) {
|
|||
};
|
||||
this.notifyObserversAround('execute', context, function(context, done) {
|
||||
self.executeSQL(context.req.sql, context.req.params, context.options, function(err, info) {
|
||||
if(err){
|
||||
debug('Error: %j %j %j', err, context.req.sql, context.req.params);
|
||||
}
|
||||
|
||||
if (!err && info != null) {
|
||||
context.res = info;
|
||||
}
|
||||
|
@ -1065,6 +1069,10 @@ SQLConnector.prototype.all = function find(model, filter, options, cb) {
|
|||
return self.fromRow(model, obj);
|
||||
});
|
||||
if (filter && filter.include) {
|
||||
if(filter.where) {
|
||||
options.filterWhere = filter.where;
|
||||
}
|
||||
|
||||
self.getModelDefinition(model).model.include(
|
||||
objs, filter.include, options, cb);
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue