summaryrefslogtreecommitdiff
path: root/app/finders/issuable_finder.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/finders/issuable_finder.rb')
-rw-r--r--app/finders/issuable_finder.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/app/finders/issuable_finder.rb b/app/finders/issuable_finder.rb
index cf706a8f98e..7b0cd17a761 100644
--- a/app/finders/issuable_finder.rb
+++ b/app/finders/issuable_finder.rb
@@ -194,8 +194,7 @@ class IssuableFinder
def use_cte_for_search?
strong_memoize(:use_cte_for_search) do
next false unless search
- # Only simple unsorted & simple sorts can use CTE
- next false if params[:sort].present? && !params[:sort].in?(klass.simple_sorts.keys)
+ next false unless default_or_simple_sort?
attempt_group_search_optimizations? || attempt_project_search_optimizations?
end
@@ -244,6 +243,10 @@ class IssuableFinder
klass.all
end
+ def default_or_simple_sort?
+ params[:sort].blank? || params[:sort].to_s.in?(klass.simple_sorts.keys)
+ end
+
def attempt_group_search_optimizations?
params[:attempt_group_search_optimizations]
end