adonis-lucid-mongodb
Advanced tools
Comparing version 0.10.7 to 0.10.8
@@ -8,3 +8,3 @@ { | ||
}, | ||
"version": "0.10.7", | ||
"version": "0.10.8", | ||
"scripts": { | ||
@@ -11,0 +11,0 @@ "lint": "standard", |
@@ -1212,3 +1212,22 @@ 'use strict' | ||
const relations = _.isArray(arguments[0]) ? arguments[0] : _.toArray(arguments) | ||
this.eagerLoad.with(relations) | ||
relations.forEach(item => { | ||
if (_.isObject(item)) { | ||
this.eagerLoad.with([item.relation]) | ||
if (item.scope) { | ||
if (_.isObject(item.scope)) { | ||
this.scope(item.relation, function (query) { | ||
if (item.scope.where) { query = query.where(item.scope.where) } | ||
if (item.scope.with) { query = query.with(item.scope.with) } | ||
if (item.scope.limit) { query = query.limit(item.scope.limit) } | ||
if (item.scope.skip) { query = query.skip(item.scope.skip) } | ||
if (item.scope.sort) { query = query.sort(item.scope.sort) } | ||
}) | ||
} else if (item) { | ||
this.scope(item.relation, item.scope) | ||
} | ||
} | ||
} else { | ||
this.eagerLoad.with([item]) | ||
} | ||
}) | ||
return this | ||
@@ -1215,0 +1234,0 @@ } |
@@ -265,3 +265,2 @@ 'use strict' | ||
relations.forEach(item => { | ||
console.log(item) | ||
if (_.isObject(item)) { | ||
@@ -268,0 +267,0 @@ target.eagerLoad.with([item.relation]) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7801
213332