Issue Creation Checklist
Issue Description
What was unclear/insufficient/not covered in the documentation
I suspect that Chapter Multiple associations involving the same models contains misleading examples of association aliases:
Team.hasOne(Game, { as: 'HomeTeam', foreignKey: 'homeTeamId' });
Team.hasOne(Game, { as: 'AwayTeam', foreignKey: 'awayTeamId' });
Game.belongsTo(Team);
If I define HomeTeam and AwayTeam aliases, then, for instance, to fetch the team's home game using lazy loading I need to call team.getHomeTeam(). This doesn't make sense to me.
If possible: Provide some suggestion on how we can enhance the docs
To change the aliases to HomeGame and AwayGame:
Team.hasOne(Game, { as: 'HomeGame', foreignKey: 'homeTeamId' });
Team.hasOne(Game, { as: 'AwayGame', foreignKey: 'awayTeamId' });
Game.belongsTo(Team);
Issue Creation Checklist
Issue Description
What was unclear/insufficient/not covered in the documentation
I suspect that Chapter Multiple associations involving the same models contains misleading examples of association aliases:
If I define
HomeTeamandAwayTeamaliases, then, for instance, to fetch the team's home game using lazy loading I need to callteam.getHomeTeam(). This doesn't make sense to me.If possible: Provide some suggestion on how we can enhance the docs
To change the aliases to
HomeGameandAwayGame: