Thanks for the quick help Jeremy. I'll give it a try. Scott
On Sat, Dec 11, 2010 at 8:24 PM, Jeremy Evans <[email protected]>wrote: > On Dec 11, 7:46 pm, Scott LaBounty <[email protected]> wrote: > > All, > > > > I have three items, books, tunes, and keys. A book can have multiple > tunes, > > and a tune can appear in multiple books in different keys. I'm not quite > > sure how to express this either as database tables or models. If it were > > just say books and tunes, I'd have a join table between them and > > many_to_many relationships. I'm just not sure how to add in the third > piece. > > You want a three way join table: > > books_tunes_keys: > book_id references books > tune_id references tunes > key_id references keys > > You can use a standard Sequel many_to_many relationship, but you will > need to specify the :join_table=>:books_tunes_keys option. > > Jeremy > > -- > You received this message because you are subscribed to the Google Groups > "sequel-talk" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]<sequel-talk%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/sequel-talk?hl=en. > > -- Scott http://steamcode.blogspot.com/ -- You received this message because you are subscribed to the Google Groups "sequel-talk" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/sequel-talk?hl=en.
