app/presenters/summary/sections/permission_questions.rb
def affirmative_permission_questions
        permission_relationships.map do |relationship|
          permission_attributes.map do |attr|
            answer = relationship.try!(attr)

            next if answer.eql?(GenericYesNo::NO.to_s)

            # Break the loop and return the first `yes` answer found
            break Answer.new(
              "child_permission_#{attr}", answer,
              i18n_opts: { applicant_name: relationship.person.full_name, child_name: relationship.minor.full_name }
            )
          end
        end.flatten.compact
      end
# Only loop through relationships that entered the non-parents journey,
# i.e. those having at least the first of those attributes as not `nil`.
#
# This saves us from having to iterate through all the relationships, as
# many of those will be respondents, other parties, or other children.
#
Only loop through relationships that entered the non-parents journey,
i.e. those having at least the first of those attributes as not `nil`.

This saves us from having to iterate through all the relationships, as
many of those will be respondents, other parties, or other children.
Only loop through relationships that entered the non - parents journey i . e . those having at least the first of those attributes as not ` nil ` . This saves us from having to iterate through all the relationships as many of those will be respondents other parties or other children .
def affirmative_permission_questions
        permission_relationships.map do |relationship|
          permission_attributes.map do |attr|
            answer = relationship.try!(attr)
            next if answer.eql?(GenericYesNo::NO.to_s)
            break Answer.new(
              "child_permission_#{attr}", answer,
              i18n_opts: { applicant_name: relationship.person.full_name, child_name: relationship.minor.full_name }
            )
          end
        end.flatten.compact
      end
def affirmative_permission_questions permission_relationships . map do | relationship | permission_attributes . map do | attr | answer = relationship . try! ( attr ) next if answer . eql? ( GenericYesNo :: NO . to_s ) break Answer . new ( "child_permission_#{attr}" , answer , i18n_opts : { applicant_name : relationship . person . full_name , child_name : relationship . minor . full_name } ) end end . flatten . compact end
Only loop through relationships that entered the non-parents journey,
i.e.
Only loop through relationships that entered the non - parents journey i . e .
# Break the loop and return the first `yes` answer found