Skip to content
Snippets Groups Projects
Commit 76a1a7a2 authored by Jarka Kadlecova's avatar Jarka Kadlecova
Browse files

Extract status count key to a method

parent 97e2de1d
No related branches found
No related tags found
1 merge request!10495Merge Requests - Assignee
Loading
Loading
@@ -128,7 +128,7 @@ class IssuableFinder
labels_count = 1 if use_cte_for_search?
 
finder.execute.reorder(nil).group(:state).count.each do |key, value|
counts[Array(key).last.to_sym] += value / labels_count
counts[count_key(key)] += value / labels_count
end
 
counts[:all] = counts.values.sum
Loading
Loading
@@ -297,6 +297,10 @@ class IssuableFinder
klass.all
end
 
def count_key(value)
Array(value).last.to_sym
end
# rubocop: disable CodeReuse/ActiveRecord
def by_scope(items)
return items.none if current_user_related? && !current_user
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment