Browse Source

About this log is only completed when privacy notice has been marked as shown

pull/187/head
baarkerlounger 3 years ago
parent
commit
5500206d50
  1. 7
      app/models/form/subsection.rb

7
app/models/form/subsection.rb

@ -30,11 +30,16 @@ class Form::Subsection
qs = applicable_questions(case_log) qs = applicable_questions(case_log)
return :not_started if qs.all? { |question| case_log[question.id].blank? } return :not_started if qs.all? { |question| case_log[question.id].blank? }
return :completed if qs.all? { |question| case_log[question.id].present? } return :completed if qs.all? { |question| case_log[question.id].present? } && !invalidated?(case_log)
:in_progress :in_progress
end end
def invalidated?(case_log)
applicable_questions(case_log).map(&:id).include?("gdpr_acceptance") &&
case_log["gdpr_acceptance"] == "No"
end
def is_incomplete?(case_log) def is_incomplete?(case_log)
%i[not_started in_progress].include?(status(case_log)) %i[not_started in_progress].include?(status(case_log))
end end

Loading…
Cancel
Save