From 6b85a538c12942c0bb4581c2b9630f520e3477cc Mon Sep 17 00:00:00 2001 From: Alice Gaudon Date: Mon, 27 Jul 2020 10:57:19 +0200 Subject: [PATCH] ManyModelRelation: fix eagerloading not working --- src/db/ModelRelation.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/db/ModelRelation.ts b/src/db/ModelRelation.ts index bc6a39e..13f7684 100644 --- a/src/db/ModelRelation.ts +++ b/src/db/ModelRelation.ts @@ -145,7 +145,7 @@ export class ManyModelRelation extends ModelRe } public async populate(models: ModelQueryResult): Promise { - this.cachedModels = models.filter(m => m[this.dbProperties.foreignKey] === this.getModelID); + this.cachedModels = models.filter(m => m[this.dbProperties.foreignKey] === this.getModelID()); } }