Forum: Ruby on Rails Table relation problems

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
2192b6bca4e477ee3a3fb7fd0c52f35a?d=identicon&s=25 Israel Guerra (Guest)
on 2009-02-27 18:24
(Received via mailing list)
Hi.

I need to know if it's possible to do something like this:
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 Guerra
Joan Rivers  - "The first time I see a jogger smiling, I'll consider
it."
This topic is locked and can not be replied to.