app/models/section.rb
def has_answers?
    self.questions.each do |question|
      if question.answers.present?
        return true
      end
    end
    false
  end
#Function to check if any of the section's questions has answers associated
Function to check if any of the section's questions has answers associated
Function to check if any of the section ' s questions has answers associated
def has_answers?
    self.questions.each do |question|
      if question.answers.present?
        return true
      end
    end
    false
  end
def has_answers? self . questions . each do | question | if question . answers . present? return true end end false end
Function to check if any of the section's questions has answers associated
Function to check if any of the section ' s questions has answers associated