Capture includeHasMany() as a find()'s caller by findCaller option
To replace incorrect location of capturing this condition in find() in loopback-connector/lib/sql.js proposed earlier in https://github.com/strongloop/loopback-connector/pull/34. Being set to 'includeHasMany', findCaller option triggers injection of PARTITION BY clause in buildColumnNames() in loopback-connector-mssql/lib/mssql.js only when find() function is called to process include filter with 'has many' relation.
This commit is contained in:
parent
84e606bc59
commit
96020c7e7e
|
@ -507,6 +507,7 @@ Inclusion.include = function (objects, include, options, cb) {
|
|||
inq: uniq(sourceIds)
|
||||
};
|
||||
relation.applyScope(null, filter);
|
||||
options.findCaller = 'includeHasMany';
|
||||
relation.modelTo.find(filter, options, targetFetchHandler);
|
||||
/**
|
||||
* Process fetched related objects
|
||||
|
|
Loading…
Reference in New Issue