You will most likely need an intermediate table like UserGames
(or PlayerGames if you prefer)

Game:
has_many :user_games
has_many :users, :through => :user_games

User:
has_many :user_games
has_many :games, :through => :user_games

this requires the table UserGames with the user_id and game_id fields

the second association definition will allow you to get all
users in a game (or all games of a user) like:

@user = User.find(:first,...)
@user.games

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to