# Data relationships for a World Cup Football App

**URL:** <https://www.ruby-forum.com/t/data-relationships-for-a-world-cup-football-app/187465>\
**Category:** Rails\
**Created:** [April 23, 2010, 4:27pm UTC](https://www.ruby-forum.com/t/data-relationships-for-a-world-cup-football-app/187465 "2010-04-23T16:27:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bingobob](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/e480ec/32.png) [@bingobob](https://www.ruby-forum.com/u/bingobob)\
**Post date:** [April 23, 2010, 4:27pm UTC](https://www.ruby-forum.com/t/data-relationships-for-a-world-cup-football-app/187465/1 "2010-04-23T16:27:15Z")

</div>

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.
