diff options
author | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-10-17 17:30:49 -0200 |
---|---|---|
committer | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-10-19 14:58:27 -0200 |
commit | d3b76e832f0afc38e2d0ffdff540c708a74ac26c (patch) | |
tree | 9c7b92639ad5aaceda6ab73f5a396de256aa65fd /lib | |
parent | 1e5ea6e7e05cd45fc56d0341ac8b5c32e57779b5 (diff) | |
download | gitlab-ce-d3b76e832f0afc38e2d0ffdff540c708a74ac26c.tar.gz |
Reuse LabelsFinder on Banzai::Filter::LabelReferenceFilter
Diffstat (limited to 'lib')
-rw-r--r-- | lib/banzai/filter/label_reference_filter.rb | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/lib/banzai/filter/label_reference_filter.rb b/lib/banzai/filter/label_reference_filter.rb index 21085ae6d49..c24831e68ee 100644 --- a/lib/banzai/filter/label_reference_filter.rb +++ b/lib/banzai/filter/label_reference_filter.rb @@ -39,13 +39,7 @@ module Banzai end def find_labels(project) - 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})") + LabelsFinder.new(nil, project_id: project.id).execute(authorized_only: false) end # Parameters to pass to `Label.find_by` based on the given arguments |