title: ActiveRecord has_many where child model is greater than 0
body: <p>I'm trying to solve a seemingly simple AR problem I'm having. I can't figure out how to return a list of events that have 1 or more attendees, and the docs examples use <code>cache_control</code> which I don't want to use.</p>
  
  <p>I have a simple event model with a <code>has_many</code> relationship:</p>
  
  <pre><code>class Event &lt; ActiveRecord::Base
    has_many :attendees
  end
  </code></pre>
  
  <p>and an attendees model that belongs to event</p>
  
  <pre><code>class Attendees &lt; ActiveRecord::Base
    belongs_to :event
  end
  </code></pre>
  
  <p>But some events will have 0 attendees. So what's the ActiveRecord way of doing this without using <code>cache_control</code> or writing a custom SQL statement?</p>
  
  <p>It seems like it would be something like: </p>
  
  <p><code>Event.where(attendees.count &gt; 0)</code></p>
  
  <p>but I keep getting a column error. </p>