From 8c31adac4436a8d21f059a5cb44f8e6245ce8e7a Mon Sep 17 00:00:00 2001 From: Kat <54268893+kosiakkatrina@users.noreply.github.com> Date: Thu, 6 Feb 2025 14:46:09 +0000 Subject: [PATCH] Update if statements --- app/controllers/form_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/form_controller.rb b/app/controllers/form_controller.rb index 31cc82a51..2cb65edaf 100644 --- a/app/controllers/form_controller.rb +++ b/app/controllers/form_controller.rb @@ -155,7 +155,7 @@ private next unless question_params - if %w[checkbox].include?(question.type) + if question.type == "checkbox" question.answer_keys_without_dividers.each do |option| result[option] = 1 if question_params.include?(option) end @@ -347,7 +347,7 @@ private end def question_missing_response?(responses_for_page, question) - if %w[checkbox].include?(question.type) + if question.type == "checkbox" answered = question.answer_keys_without_dividers.map do |option| session["fields"][option] = @log[option] = params[@log.log_type][question.id].include?(option) ? 1 : 0 params[@log.log_type][question.id].exclude?(option)