title: Ruby on Rails: How to structure a has_many, through association when join model uses a belongs_to
body: <p>I'm trying to create a has_many, through association when the join model uses a belongs_to.</p>
  
  <p>Example here:</p>
  
  <pre><code>class User
    has_many :projects, through: :project_memberships
  end
  
  class ProjectMembership
    belongs_to :project
  end
  
  class Project
    has_many :project_memberships
  end
  </code></pre>
  
  <p>Rails is telling me this association is invalid. If it's not possible to use a <code>:through</code> association here, what's the best way to use ActiveRecord to access all projects a user has memberships to?</p>