title: Rails Rich Associations - undefined method error
body: <p>I have three basic models that I am working with:</p>
  
  <pre><code>class User &lt; ActiveRecord::Base
    has_many :assignments
  end
  
  class Assignment &lt; ActiveRecord::Base
    belongs_to :group
    belongs_to :user  
  end
  
  class Group &lt; ActiveRecord::Base
    has_many :assignments
  end
  </code></pre>
  
  <p>Using this schema, I would assume the "Assignment" model is sort of the join table, which holds the information for which users belong to which groups.  So, what I am trying to do is, using a User object, find out what groups they belong to.  </p>
  
  <p>In Rail console, I am doing the following:</p>
  
  <pre><code>me = User.find(1)
  </code></pre>
  
  <p>Which returns the user object, as it should.  Then, I attempt to see which "groups" this user belongs to, which I thought it would go through the "Assignment" model.  But, I'm obviously doing something wrong:</p>
  
  <pre><code>me.groups
  </code></pre>
  
  <p>Which returns:</p>
  
  <pre><code>NoMethodError: undefined method `groups' for #&lt;User:0x007fd5d6320c68&gt;
  </code></pre>
  
  <p>How would I go about finding out which "groups" the "me" object belongs to?</p>
  
  <p>Thanks very much!</p>