Fix replace label references with links for group labels

This commit is contained in:
Douglas Barbosa Alexandre 2016-10-10 23:37:07 -03:00
parent 1fd8470087
commit 00e3c2e00f
1 changed files with 7 additions and 1 deletions

View File

@ -39,7 +39,13 @@ module Banzai
end
def find_labels(project)
LabelsFinder.new(user, project_id: project.id).execute
label_ids = []
label_ids << project.group.labels.select(:id) if project.group.present?
label_ids << project.labels.select(:id)
union = Gitlab::SQL::Union.new(label_ids)
Label.where("labels.id IN (#{union.to_sql})")
end
# Parameters to pass to `Label.find_by` based on the given arguments