how would I map relationships for world cup football matches.

Currently in my app I have Countries, that's it, all 32 competing
nations are represented, with flags and details working great.

I'd like to introduce two new models (Match and Stadium).

A football match is obviously between two Countries in a Stadium.

How could I set that up best?

Country
  has_many Matches

Match
  has_many Countries
  belongs_to Stadium

Stadium
  has_many Matches


Bit confused as a Match will only ever be between two sides of course.
Do I require habtm? What's best to do here.
-- 
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 rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to