Merge pull request #643 from rus0000/includes-with-transaction-support
Includes with transaction support
This commit is contained in:
commit
e72a3cac2f
|
@ -323,7 +323,7 @@ Inclusion.include = function (objects, include, options, cb) {
|
|||
/**
|
||||
* 1st DB Call of 2 step process. Get through model objects first
|
||||
*/
|
||||
relation.modelThrough.find(throughFilter, throughFetchHandler);
|
||||
relation.modelThrough.find(throughFilter, options, throughFetchHandler);
|
||||
/**
|
||||
* Handle the results of Through model objects and fetch the modelTo items
|
||||
* @param err
|
||||
|
@ -369,7 +369,7 @@ Inclusion.include = function (objects, include, options, cb) {
|
|||
/**
|
||||
* 2nd DB Call of 2 step process. Get modelTo (target) objects
|
||||
*/
|
||||
relation.modelTo.find(filter, targetsFetchHandler);
|
||||
relation.modelTo.find(filter, options, targetsFetchHandler);
|
||||
function targetsFetchHandler(err, targets) {
|
||||
if (err) {
|
||||
return callback(err);
|
||||
|
@ -444,7 +444,7 @@ Inclusion.include = function (objects, include, options, cb) {
|
|||
/**
|
||||
* Make the DB Call, fetch all target objects
|
||||
*/
|
||||
relation.modelTo.find(filter, targetFetchHandler);
|
||||
relation.modelTo.find(filter, options, targetFetchHandler);
|
||||
/**
|
||||
* Handle the fetched target objects
|
||||
* @param err
|
||||
|
@ -507,7 +507,7 @@ Inclusion.include = function (objects, include, options, cb) {
|
|||
inq: uniq(sourceIds)
|
||||
};
|
||||
relation.applyScope(null, filter);
|
||||
relation.modelTo.find(filter, targetFetchHandler);
|
||||
relation.modelTo.find(filter, options, targetFetchHandler);
|
||||
/**
|
||||
* Process fetched related objects
|
||||
* @param err
|
||||
|
@ -597,7 +597,7 @@ Inclusion.include = function (objects, include, options, cb) {
|
|||
return;
|
||||
}
|
||||
relation.applyScope(null, typeFilter);
|
||||
Model.find(typeFilter, targetFetchHandler);
|
||||
Model.find(typeFilter, options, targetFetchHandler);
|
||||
/**
|
||||
* Process fetched related objects
|
||||
* @param err
|
||||
|
@ -662,7 +662,7 @@ Inclusion.include = function (objects, include, options, cb) {
|
|||
inq: uniq(sourceIds)
|
||||
};
|
||||
relation.applyScope(null, filter);
|
||||
relation.modelTo.find(filter, targetFetchHandler);
|
||||
relation.modelTo.find(filter, options, targetFetchHandler);
|
||||
/**
|
||||
* Process fetched related objects
|
||||
* @param err
|
||||
|
@ -729,7 +729,7 @@ Inclusion.include = function (objects, include, options, cb) {
|
|||
inq: uniq(targetIds)
|
||||
};
|
||||
relation.applyScope(null, filter);
|
||||
relation.modelTo.find(filter, targetFetchHandler);
|
||||
relation.modelTo.find(filter, options, targetFetchHandler);
|
||||
/**
|
||||
* Process fetched related objects
|
||||
* @param err
|
||||
|
|
Loading…
Reference in New Issue