title: Scope ActiveRecord Relation based on record data
body: <p>I a model like this:</p>
  
  <pre><code>class Club &lt; ActiveRecord::Base
    belongs_to :organization
    has_many :career_clubs
    has_many :careers, through: :career_clubs
  end
  </code></pre>
  
  <p>Which appropriately gets careers through the table <code>career_clubs</code>. So far this is only using the club's <code>id</code> field and getting all the records in the <code>career_clubs</code> table with that <code>id</code>.</p>
  
  <p>What I actually want this to do, is use both the <code>id</code> and <code>organization_id</code>, so that it gets all the <code>career_clubs</code> with matching <code>id</code> and <code>organization_id</code>.</p>
  
  <p>I know how to scope things using static data like below, but that doesn't seem to work here.</p>
  
  <pre><code>has_many :career_clubs, -&gt; { where active: true }
  </code></pre>