Makes the query to retrieve group labels more simpler

This commit is contained in:
Douglas Barbosa Alexandre 2016-09-20 16:09:31 -03:00
parent 32c663ff24
commit e2dd75c0a2
1 changed files with 1 additions and 1 deletions

View File

@ -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