title: How can I has_and_belongs_to_many multiple instances of the same model?
body: <p>Basically, I want to accomplish something like this:</p>
  
  <pre><code>Class Node &lt; ActiveRecord::Base
    has_and_belongs_to_many :parents, :class_name=&gt;'Node'
    has_and_belongs_to_many :children, :class_name=&gt;'Node'
  end
  </code></pre>
  
  <p>but it isn't working, and I'm not entirely sure the proper way to do this. I'm going to try explicitly defining a join table next and have both use it: If that's the solution, would the column be called "children_id" or "child_id"?</p>