提交 ce256c28 编写于 作者: S Stan Hu

Improve label filtering implementation

上级 af4d16d9
......@@ -35,13 +35,11 @@ class LabelsFinder < UnionFinder
end
def with_title(items)
# Match no labels if an empty title is supplied to avoid matching all
# labels (e.g. when an issue is moved)
return items.none if raw_title && raw_title.empty?
if title
items = items.where(title: title)
else
items.where(title: title)
elsif params[:title] || params[:name] # empty input, should match nothing
items.none
else # not filtering
items
end
end
......@@ -62,10 +60,6 @@ class LabelsFinder < UnionFinder
params[:title].presence || params[:name].presence
end
def raw_title
params[:title] || params[:name]
end
def project
return @project if defined?(@project)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册