Do not overwrite inclusion but scope them. Needed in relation hasManyThrought

This commit is contained in:
Laurent Chenay 2014-07-28 15:17:36 +02:00
parent 1b001eedd3
commit aaf037fc51
1 changed files with 8 additions and 2 deletions

View File

@ -246,9 +246,15 @@ function mergeQuery(base, update) {
} }
} }
// Overwrite inclusion // Merge inclusion
if (update.include) { if (update.include) {
base.include = update.include; if (!base.include) {
base.include = update.include;
} else {
var saved = base.include;
base.include = {};
base.include[update.include] = [saved];
}
} }
if (update.collect) { if (update.collect) {
base.collect = update.collect; base.collect = update.collect;