app/models/section.rb
def has_questions?
    return true if self.questions.any?
    self.children.each do  |s|
      return true if s.has_questions?
    end
    false
  end
#check if a generated_section or any of its descendants has questions associated.
check if a generated_section or any of its descendants has questions associated.
check if a generated_section or any of its descendants has questions associated .
def has_questions?
    return true if self.questions.any?
    self.children.each do  |s|
      return true if s.has_questions?
    end
    false
  end
def has_questions? return true if self . questions . any? self . children . each do | s | return true if s . has_questions? end false end
check if a generated_section or any of its descendants has questions associated.
check if a generated_section or any of its descendants has questions associated .