summaryrefslogtreecommitdiff
path: root/app/finders
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-09-20 16:09:31 -0300
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-10-19 14:58:24 -0200
commite2dd75c0a2d863c8e530e54f3a0a015bdec1e84f (patch)
tree837b9f025f7d515f18288927bca9197ca1d6a0c6 /app/finders
parent32c663ff248f6ad2f2fa10fd2e81d6535fb88fd6 (diff)
downloadgitlab-ce-e2dd75c0a2d863c8e530e54f3a0a015bdec1e84f.tar.gz
Makes the query to retrieve group labels more simpler
Diffstat (limited to 'app/finders')
-rw-r--r--app/finders/labels_finder.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/finders/labels_finder.rb b/app/finders/labels_finder.rb
index 85ef9bea08d..b8828bcdd32 100644
--- a/app/finders/labels_finder.rb
+++ b/app/finders/labels_finder.rb
@@ -16,7 +16,7 @@ class LabelsFinder < UnionFinder
def label_ids
label_ids = []
- label_ids << Label.where(group_id: projects.where.not(group: nil).select(:namespace_id)).select(:id)
+ label_ids << Label.where(group_id: projects.joins(:namespace).where(namespaces: { type: 'Group' }).select(:namespace_id)).select(:id)
label_ids << Label.where(project_id: projects.select(:id)).select(:id)
end