Search the web
Sign In
New User? Sign Up
RubyOnRails · Ruby on Rails
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Want to share photos of your group with the world? Add a group photo to Flickr.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
table has two references to same table   Message List  
Reply | Forward Message #92 of 107 |
Re: table has two references to same table

--- In RubyOnRails@yahoogroups.com, "mpfilbin" <mpfilbin@...> wrote:
>
> >> match1 << team1
> >> ... output...
> >> match1 << team2
> >> .. output ...
> >> match1.teams
> >> should return an array of teams associated with this match.

thx, mpfilbin.

i knew how to use habtm, but thats not what i wanted. i dont want to
have 1 or 3 or 4 teams on a match, but exactly two: one home, one away
team.

alexandre helped me out. thanks anyway.




Wed Jan 30, 2008 6:14 pm

tmangner
Offline Offline
Send Email Send Email

Forward
Message #92 of 107 |
Expand Messages Author Sort by Date

hi there, i got to tables "teams" and "matches". create_table :teams do |t| t.string :name t.timestamps end create_table :matches do |t| t.datetime :kickoff ...
Torsten Mangner
tmangner
Offline Send Email
Jan 30, 2008
1:17 pm

Hi Torsten, I am not sure I entire understand your situation, but if I were you this is how I might set it up: First, I would have a table teams, a table...
mpfilbin
Offline Send Email
Jan 30, 2008
5:51 pm

... thx, mpfilbin. i knew how to use habtm, but thats not what i wanted. i dont want to have 1 or 3 or 4 teams on a match, but exactly two: one home, one away ...
Torsten Mangner
tmangner
Offline Send Email
Jan 30, 2008
6:20 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help