Forum: Ruby on Rails Association: has_many_reflexive?

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
9cace61bc2a5972d44d5e1a1b8c145af?d=identicon&s=25 (Guest)
on 2007-01-19 16:29
(Received via mailing list)
So, I'm trying to make the sort of thing where you'd have an
intermediate join table which for simplicities sake, stores all the
friends for a person...



But, what'd be nice would be if it were unimportant from which side the
connection were made (i.e. non-directional graph), such that...
class Person
     has_many :friends, :association_id =>

person.friends => #SQL("select * from persons_table join friends_table
on friends_table.person_id_left = #{} or
friends_table.person_id_right = #{}")

Seems like a pretty common scenario, but my google searches aren't
really turning up much, anybody done this?
This topic is locked and can not be replied to.