From 6f0f9ab95c60698789829ffc1a5b2a69b4d66a61 Mon Sep 17 00:00:00 2001 From: baarkerlounger Date: Thu, 5 May 2022 10:36:00 +0100 Subject: [PATCH] Dry depends on evaluation --- app/models/form/question.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/models/form/question.rb b/app/models/form/question.rb index 96276f48a..33958997b 100644 --- a/app/models/form/question.rb +++ b/app/models/form/question.rb @@ -65,9 +65,7 @@ class Form::Question def hidden_in_check_answers?(case_log) if hidden_in_check_answers.is_a?(Hash) - hidden_in_check_answers["depends_on"].any? do |hsh| - hsh.all? { |key, value| case_log[key] == value } - end + form.depends_on_met(hidden_in_check_answers["depends_on"], case_log) else hidden_in_check_answers end