Commit 65fb8ca1 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

Prevent duplicates in issue finder when filter by label


Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 54183ccf1289
...@@ -125,7 +125,13 @@ ...@@ -125,7 +125,13 @@
def by_label(items) def by_label(items)
if params[:label_name].present? if params[:label_name].present?
items = items.joins(:labels).where("labels.title in (?)", params[:label_name].split(",")) label_names = params[:label_name].split(",")
item_ids = LabelLink.joins(:label).
where('labels.title in (?)', label_names).
where(target_type: klass.name).pluck(:target_id)
items = items.where(id: item_ids)
end end
items items
......
Supports Markdown
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