From 13b9e47e87d948252de9d721c228c4500b2c0188 Mon Sep 17 00:00:00 2001 From: Rus1 Date: Wed, 24 Jun 2015 02:08:07 +0300 Subject: [PATCH] Includes with transaction support --- lib/include.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/include.js b/lib/include.js index 30f14313..a122adc1 100644 --- a/lib/include.js +++ b/lib/include.js @@ -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); @@ -443,7 +443,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 @@ -505,7 +505,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 @@ -595,7 +595,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 @@ -660,7 +660,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 @@ -727,7 +727,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