Two models:
class Task < ActiveRecord::Base
has_many :subtasks
end
class Subtask < ActiveRecord::Base
belongs_to :task
end
Subtask have boolean attribute that set to true if subtask is complete.
How can i check if a task has at least one completed subtask?