title: Getting rows count on inner join rails scope
body: <p>I have the following scope:</p>
  
  <pre><code>scope :billable, -&gt; (range_start = nil, range_end = nil) {
      joins(:bids)
        .where("auctions.complete = 1 AND auctions.starts_at &gt;= ? AND auctions.starts_at &lt;= ? AND auctions.listing = 0", range_start, range_end)
        .group("auctions.id")
    }
  </code></pre>
  
  <p>I am trying to determine how to add a constrain to the where clause that allows me to select where count(bids) > auctions.items_count</p>