From f42e40e1e703133355981898dc8a87965ebc3554 Mon Sep 17 00:00:00 2001 From: Manny Dinssa <44172848+Dinssa@users.noreply.github.com> Date: Fri, 4 Oct 2024 14:31:46 +0100 Subject: [PATCH] Refactor methods --- app/helpers/filters_helper.rb | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/app/helpers/filters_helper.rb b/app/helpers/filters_helper.rb index 7579d2e61..e43614d45 100644 --- a/app/helpers/filters_helper.rb +++ b/app/helpers/filters_helper.rb @@ -346,36 +346,31 @@ private def assigned_to_filter_selected?(selected_filters, value) return true if !selected_filters.key?("user") && value == :all - return true if selected_filters["assigned_to"] == value.to_s - false + selected_filters["assigned_to"] == value.to_s end def owning_organisation_filter_selected?(selected_filters, value) return true if !selected_filters.key?("owning_organisation") && value == :all - return true if (selected_filters["owning_organisation"].present? || selected_filters["owning_organisation_text_search"].present?) && value == :specific_org - false + (selected_filters["owning_organisation"].present? || selected_filters["owning_organisation_text_search"].present?) && value == :specific_org end def managing_organisation_filter_selected?(selected_filters, value) return true if !selected_filters.key?("managing_organisation") && value == :all - return true if (selected_filters["managing_organisation"].present? || selected_filters["managing_organisation_text_search"].present?) && value == :specific_org - false + (selected_filters["managing_organisation"].present? || selected_filters["managing_organisation_text_search"].present?) && value == :specific_org end def uploaded_by_filter_selected?(selected_filters, value) return true if !selected_filters.key?("user") && value == :all - return true if selected_filters["uploaded_by"] == value.to_s - false + selected_filters["uploaded_by"] == value.to_s end def uploading_organisation_filter_selected?(selected_filters, value) return true if !selected_filters.key?("uploading_organisation") && value == :all - return true if (selected_filters["uploading_organisation"].present? || selected_filters["uploading_organisation_text_search"].present?) && value == :specific_org - false + (selected_filters["uploading_organisation"].present? || selected_filters["uploading_organisation_text_search"].present?) && value == :specific_org end end