ManyModelRelation: fix eagerloading not working

This commit is contained in:
Alice Gaudon 2020-07-27 10:57:19 +02:00
parent 8746ad2ea3
commit 6b85a538c1

View File

@ -145,7 +145,7 @@ export class ManyModelRelation<S extends Model, O extends Model> extends ModelRe
} }
public async populate(models: ModelQueryResult<O>): Promise<void> { public async populate(models: ModelQueryResult<O>): Promise<void> {
this.cachedModels = models.filter(m => m[this.dbProperties.foreignKey] === this.getModelID); this.cachedModels = models.filter(m => m[this.dbProperties.foreignKey] === this.getModelID());
} }
} }