search for: player2_id

Displaying 1 result from an estimated 1 matches for "player2_id".

Did you mean: player1_id
2006 Apr 07
5
Confusion about has_many / belongs_to ...
I have a table called players and its model Player, and I have a table called games and its model Game. In the games table I have: player1_id int(11) player2_id int(11) I want the tables to be associated so that I can access the player objects using table.player1 and table.player2 rather than having to lookup the objects based on the ids. I am not sure how to go about this but I suspect I need to use either has_many or belongs_to or one of the mixed v...