Makes the query to retrieve group labels more simpler

parent 32c663ff
...@@ -16,7 +16,7 @@ class LabelsFinder < UnionFinder ...@@ -16,7 +16,7 @@ class LabelsFinder < UnionFinder
def label_ids def label_ids
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) label_ids << Label.where(project_id: projects.select(:id)).select(:id)
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment