# Table relation problems

**URL:** <https://www.ruby-forum.com/t/table-relation-problems/161596>\
**Category:** Rails\
**Created:** [February 27, 2009, 6:24pm UTC](https://www.ruby-forum.com/t/table-relation-problems/161596 "2009-02-27T18:24:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Israel\_G](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/c77e96/32.png) [@Israel\_G](https://www.ruby-forum.com/u/Israel_G)\
**Post date:** [February 27, 2009, 6:24pm UTC](https://www.ruby-forum.com/t/table-relation-problems/161596/1 "2009-02-27T18:24:21Z")

</div>

Hi.

I need to know if it’s possible to do something like this:  
[http://pastie.org/402205](http://pastie.org/402205)

The table game\_guesses has 2 keys for team: home\_key and guest\_key. The  
problem is that a normal relation would be team has\_many/has\_one  
game\_guessbut that is not the case.

I just want to see the team information using guess.homeTeam.name or  
guess.guestTeam.name (or other information of the Team object)

Is there a way to solve it? I tried to change the model, but eventually  
it  
would lead to a situation like this one.

## Thanks,

Israel G.  
Joan Rivers - “The first time I see a jogger smiling, I’ll consider  
it.”
