Skip to content
This repository was archived by the owner on Apr 17, 2020. It is now read-only.

Commit 6a544bc

Browse files
author
Joel Mukuthu
committed
fix: support joining with children models
1 parent 7404ac6 commit 6a544bc

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/KnormRelations.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,10 @@ class KnormRelations {
9797

9898
for (const reference of asArray(references)) {
9999
// TODO: validate that reference is Field instance?
100-
if (reference.model === Model) {
100+
if (
101+
reference.model === Model ||
102+
Model.prototype instanceof reference.model
103+
) {
101104
resolvedReferences.push({
102105
// TODO: Model.getField()
103106
from: this._config._fields[fieldName],

0 commit comments

Comments
 (0)