Results 1 to 2 of 2
Jan 25, 2006, 18:27 #1
- Join Date
- Jun 2004
- Kansas City, MO
- 0 Post(s)
- 0 Thread(s)
Rails: How to implement multiple FK's from same table
How would I implement in Rails, a model that uses two foreign keys from the same table?
I am setting up a sports schedule database. I have a team's table that has a PK of id, and then there will be a game's table with two references to the team table, a home team and an away team. Since there are two columns, naming them the conventional way, team_id, won't work.
What do I need to do to implement this in Rails both on the DB side and within my Games model?Chris Hasenpflug