Skip to content

Commit

Permalink
fix(lucid): include all nested relationships
Browse files Browse the repository at this point in the history
  • Loading branch information
Radoslaw Mejer committed Jan 4, 2018
1 parent 4a9e5a2 commit d713f01
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Lucid/EagerLoad/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ class EagerLoad {
* @private
*/
_chainNested ({ relatedQuery }, nested) {
if (nested) {
const name = _.first(_.keys(nested))
relatedQuery.with(name, nested[name])
}
Object.entries(nested || {})
.forEach(([name, callback]) => {
relatedQuery.with(name, callback)
})
}

/**
Expand Down

0 comments on commit d713f01

Please sign in to comment.