From 196e3ae912be53fd77d65d0171cd7b8d309b7ba7 Mon Sep 17 00:00:00 2001 From: Manny Dinssa <44172848+Dinssa@users.noreply.github.com> Date: Mon, 18 Nov 2024 16:15:12 +0000 Subject: [PATCH] Move logic to section model --- app/models/form/section.rb | 4 ++++ app/views/logs/_tasklist.html.erb | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/models/form/section.rb b/app/models/form/section.rb index 97a128f74..a836bd45a 100644 --- a/app/models/form/section.rb +++ b/app/models/form/section.rb @@ -10,4 +10,8 @@ class Form::Section @subsections = hsh["subsections"].map { |s_id, s| Form::Subsection.new(s_id, s, self) } end end + + def displayed_in_tasklist?(log) + subsections.any? { |subsection| subsection.displayed_in_tasklist?(log) } + end end diff --git a/app/views/logs/_tasklist.html.erb b/app/views/logs/_tasklist.html.erb index 2611553a3..e2f977a70 100644 --- a/app/views/logs/_tasklist.html.erb +++ b/app/views/logs/_tasklist.html.erb @@ -1,6 +1,6 @@