Hello,
The package does not appear to work where the classes being used extend a higher base model. For example, I have the following hierarchy:
export class Employee extends PayrollBaseModel { ... }
export class PayrollBaseModel extends Model { ... }
This becomes necessary in my case because my application is multi-db, and the PayrollBaseModel is bound to a knex instance pointing to the Payroll DB.
static relationMappings = new ModelRelationshipFacade(Employee)
.belongsToOne(Department)
.getRelationships();
Attempting to use your package in the Employee class - say to the Department class - complains that type of Employee cannot be assigned to ModelClass. In this case Employee and Department both extend PayrollBaseModel.
Argument of type 'typeof Employee' is not assignable to parameter of type 'ModelClass'. The types of 'QueryBuilder.forClass' are incompatible between these types.
Using the regular relationshipMapping works as expected.
How do I get around this?
Hello,
The package does not appear to work where the classes being used extend a higher base model. For example, I have the following hierarchy:
export class Employee extends PayrollBaseModel { ... }export class PayrollBaseModel extends Model { ... }This becomes necessary in my case because my application is multi-db, and the
PayrollBaseModelis bound to a knex instance pointing to the Payroll DB.Attempting to use your package in the Employee class - say to the Department class - complains that type of Employee cannot be assigned to ModelClass. In this case
EmployeeandDepartmentboth extendPayrollBaseModel.Using the regular relationshipMapping works as expected.
How do I get around this?