summaryrefslogtreecommitdiff
path: root/app/finders
diff options
context:
space:
mode:
authorFelipe Artur <felipefac@gmail.com>2017-12-26 17:16:43 -0200
committerFelipe Artur <felipefac@gmail.com>2018-01-05 13:26:30 -0200
commit06d4f07a041a70fe9462bcae47b1b191908347ab (patch)
tree4c6a81bc9fbbbfb00e0afd83f16a83dfb94ed4df /app/finders
parenta5a0f3f725c4f5c6d11d33e18493d93e07e53183 (diff)
downloadgitlab-ce-06d4f07a041a70fe9462bcae47b1b191908347ab.tar.gz
Improve filtering issues by label performanceissue_40500
Diffstat (limited to 'app/finders')
-rw-r--r--app/finders/issuable_finder.rb15
1 files changed, 5 insertions, 10 deletions
diff --git a/app/finders/issuable_finder.rb b/app/finders/issuable_finder.rb
index b46ec5e5350..493e7985d75 100644
--- a/app/finders/issuable_finder.rb
+++ b/app/finders/issuable_finder.rb
@@ -374,19 +374,14 @@ class IssuableFinder
end
def by_label(items)
- if labels?
+ return items unless labels?
+
+ items =
if filter_by_no_label?
- items = items.without_label
+ items.without_label
else
- items = items.with_label(label_names, params[:sort])
- items_projects = projects(items)
-
- if items_projects
- label_ids = LabelsFinder.new(current_user, project_ids: items_projects).execute(skip_authorization: true).select(:id)
- items = items.where(labels: { id: label_ids })
- end
+ items.with_label(label_names, params[:sort])
end
- end
items
end