title: How to filter query result?
body: <p>How would I filter out experiments that hasn't any associated circuit? </p>
  
  <p>My Experiment model:</p>
  
  <pre><code>has_many :circuits
  </code></pre>
  
  <p>My query:</p>
  
  <pre><code>@experiments = Experiment.where(:public=&gt;true).where(
          'updated_at &gt;= :one_month_ago,
          :one_month_ago =&gt; Time.now - 30.days
      )
  </code></pre>
  
  <p>So, I need to avoid any experiment with circuits associated equal zero.
  Any idea?</p>