summaryrefslogtreecommitdiff
path: root/app/finders/issuable_finder.rb
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-09-19 17:21:39 -0300
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-10-19 14:58:24 -0200
commit398ab263fd08a5d9d7b19c5b3d06f33814a474eb (patch)
tree5a7249f72bdec65e87abb597f22a68afa9fb9f74 /app/finders/issuable_finder.rb
parentd5a595b59702489c0b1026a0951157b8cfd3d65c (diff)
downloadgitlab-ce-398ab263fd08a5d9d7b19c5b3d06f33814a474eb.tar.gz
Allow users to apply group labels on Issues/MRs
Diffstat (limited to 'app/finders/issuable_finder.rb')
-rw-r--r--app/finders/issuable_finder.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/finders/issuable_finder.rb b/app/finders/issuable_finder.rb
index 9f170428100..37151f8d134 100644
--- a/app/finders/issuable_finder.rb
+++ b/app/finders/issuable_finder.rb
@@ -274,8 +274,10 @@ class IssuableFinder
items = items.without_label
else
items = items.with_label(label_names, params[:sort])
+
if projects
- items = items.where(labels: { project_id: projects })
+ label_ids = LabelsFinder.new(current_user, project_id: projects).execute.select(:id)
+ items = items.where(labels: { id: label_ids })
end
end
end