i have user table each user have lots of friends how to design ? act_as_tree , will it work ? any other suggestion appreciated. -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Philip Hallstrom
2008-Nov-21 19:35 UTC
Re: has_many (but parent & child should be same table )
> i have user table > each user have lots of friends > how to design ? > act_as_tree , will it work ?You could, but it would be messy since you and I could be friends so who has many? Start here: http://agilewebdevelopment.com/plugins/search?search=friends Find one that only requires a *single* row in the database to indicate you and I are friends as opposed to "Philip is a friend of Thani" *and* "Thani is a friend of Philip". Last time I did this I used http://agilewebdevelopment.com/plugins/has_many_friends . Worked well for me. -philip --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Thani Ararsu
2008-Nov-24 03:44 UTC
Re: has_many (but parent & child should be same table )
Philip Hallstrom wrote:> http://agilewebdevelopment.com/plugins/search?search=friends > > Find one that only requires a *single* row in the database to indicate > you and I are friends as opposed to "Philip is a friend of Thani" > *and* "Thani is a friend of Philip". > > Last time I did this I used > http://agilewebdevelopment.com/plugins/has_many_friends > . Worked well for me. > > -philipThanks -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---