Adam Akhtar wrote: > Hi if i have one model say with objects for each letter of the alphabet > e.g a,b,c ... x,y,z and i want to allow users to create there own > favourite pairings of these e.g. > > ab, cd, ef, gp and allow them to discuss via comments on each pairing, > whats teh best way to model this in rails?
Use a Pairing class with a polymorphic association. > > the order of teh letters DOESNT matter so ab IS the SAME as ba. Id > rather avoid duplication in my "Pairings" table because that would mean > id have to assign user commments to both ab and ba. Sort the object IDs in some unambiguous way before creating a pairing. Best, -- Marnen Laibow-Koser http://www.marnen.org [email protected] -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: 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/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

