title: How to model friend relationship in ActiveRecord
body: <p>I have a People model that I want to allow un-directed relationships on (Friend, Family, Neighbor, etc.)  When you mark one person as being the friend of another then they both are friends of each other.</p>
  
  <pre><code>Class People
    id
    name
  
  Class Relationship
    id
    person_a_id
    person_b_id
    relationship_type
  </code></pre>
  
  <p>Now, assuming we have some People data (record ids = 1,2,3,4,5) this is how the Relationship table might look:</p>
  
  <pre><code>id  person_a_id  person_b_id  relationship_type
  --  -----------  -----------  --------------------
   1     1            2           friend
   2     1            3           neighbor
  </code></pre>
  
  <p>What this tells me is that Person 1 has a friend (Person 2) and a neighbor (Person 3).  It also tells me that Person 2 has a friend (Person 1) and Person 3 has a neighbor (Person 1).</p>
  
  <p>I think I could do this with some <a href="http://railscasts.com/episodes/163-self-referential-association" rel="nofollow">Self-Referential Association</a> but I'm thinking that there is a cleaner way.  Am I missing something and there is a Gem out there, waiting to fulfill my every need (at least as far as this question goes)?  Or do I have to write one...</p>