From 3c787a0c2f446d9bc993029208a24d9926ba785c Mon Sep 17 00:00:00 2001 From: natdeanlewissoftwire Date: Tue, 19 Sep 2023 14:48:52 +0100 Subject: [PATCH] feat: reprivatise update_status! --- app/models/log.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/models/log.rb b/app/models/log.rb index ce87ba975..50a570b51 100644 --- a/app/models/log.rb +++ b/app/models/log.rb @@ -188,12 +188,6 @@ class Log < ApplicationRecord form.edit_end_date < Time.zone.now || older_than_previous_collection_year? end - def update_status! - return if skip_update_status - - self.status = calculate_status - end - private # Handle logs that are older than previous collection start date @@ -214,6 +208,12 @@ private end end + def update_status! + return if skip_update_status + + self.status = calculate_status + end + def all_subsections_completed? form.subsections.all? { |subsection| subsection.complete?(self) || subsection.not_displayed_in_tasklist?(self) } end