ooh found 'has_many_and_belongs_to' in ActiveRecord that takes care of 
the match->match_game<-game relationship nicely!

The solution i think i'm going to go with is to pre-load the game table 
and add some methods to the game model to return a game or games in the 
various ways i'll need them e.g.

get_random_game
get_random_active_game(exclude_these_games[])
get_all_active_games

My match controller can then use these as part of the logic that builds 
the match before committing it to the db.

If someone updates the maps or game_modes models then i'll trigger an 
'update_list_of_games' on the Game class to populate any new game modes 
as a result of the change.

Not sure what people feel about this but it seemed right in my head lol.
-- 
Posted via http://www.ruby-forum.com/.
-- 
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