In my application a user has a roster of players for specific games in the form of a pick model. I also have game stats for a player for a specific game. I want to create a relationship where a pick has_one game stat for the purpose of using includes to eager load the game_stats for a pick.
Is there a way to create a relationship between tables that share multiple foreign keys from other models?
Here is what I’m going for:
Model Pick
has_one :game_stat
id, game_id, player_id
Model GameStat
id, game_id, player_id, stats