From 7739fe4922f654fc507816a40eefeb1ae8d70799 Mon Sep 17 00:00:00 2001 From: Alexander Meindl Date: Sun, 10 Mar 2024 10:32:03 +0100 Subject: [PATCH] Remove priority-low-other and priority-high-other css classes for issue priorities, to solve n+1 query problems --- lib/additionals.rb | 1 - .../patches/issue_priority_patch.rb | 36 ------------------- 2 files changed, 37 deletions(-) delete mode 100644 lib/additionals/patches/issue_priority_patch.rb diff --git a/lib/additionals.rb b/lib/additionals.rb index 0300e4cd..680857c1 100644 --- a/lib/additionals.rb +++ b/lib/additionals.rb @@ -104,7 +104,6 @@ module Additionals loader.add_patch %w[ApplicationController AutoCompletesController Issue - IssuePriority TimeEntry Mailer Project diff --git a/lib/additionals/patches/issue_priority_patch.rb b/lib/additionals/patches/issue_priority_patch.rb deleted file mode 100644 index b9d8d85d..00000000 --- a/lib/additionals/patches/issue_priority_patch.rb +++ /dev/null @@ -1,36 +0,0 @@ -# frozen_string_literal: true - -module Additionals - module Patches - module IssuePriorityPatch - extend ActiveSupport::Concern - - included do - prepend InstanceOverwriteMethods - include InstanceMethods - end - - module InstanceOverwriteMethods - def css_classes - classes = super - - other_class = css_name_based_class - return classes if other_class.blank? - - "#{classes} #{other_class}" - end - end - - module InstanceMethods - # css class based on priority name - def css_name_based_class - if low? - 'priority-low-other' if position_name != 'lowest' - else - 'priority-high-other' unless %w[default highest high2 high3].include? position_name - end - end - end - end - end -end