diff options
author | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-10-10 23:37:07 -0300 |
---|---|---|
committer | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-10-19 14:58:25 -0200 |
commit | 00e3c2e00f1c81aa2f7a76e4d93c8a1fb2074d6e (patch) | |
tree | a874d3fed374495c84499936551e182c689d1795 /lib/banzai/filter | |
parent | 1fd84700874ed29a7852b0f090dbaffd86cb8d00 (diff) | |
download | gitlab-ce-00e3c2e00f1c81aa2f7a76e4d93c8a1fb2074d6e.tar.gz |
Fix replace label references with links for group labels
Diffstat (limited to 'lib/banzai/filter')
-rw-r--r-- | lib/banzai/filter/label_reference_filter.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/banzai/filter/label_reference_filter.rb b/lib/banzai/filter/label_reference_filter.rb index 2ce33aa1d15..21085ae6d49 100644 --- a/lib/banzai/filter/label_reference_filter.rb +++ b/lib/banzai/filter/label_reference_filter.rb @@ -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 |