title: Check if at least one record have a given attribute set to true
body: <p>Two models:</p>
  
  <pre><code>class Task &lt; ActiveRecord::Base
    has_many :subtasks
  
  end
  
  class Subtask &lt; ActiveRecord::Base
    belongs_to :task
  
  end
  </code></pre>
  
  <p>Subtask have boolean attribute that set to true if subtask is complete.</p>
  
  <p>How can i check if a task has at least one completed subtask?</p>