summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/finders/labels_finder.rb13
1 files changed, 5 insertions, 8 deletions
diff --git a/app/finders/labels_finder.rb b/app/finders/labels_finder.rb
index 8a85f7a2952..95e62cdb02a 100644
--- a/app/finders/labels_finder.rb
+++ b/app/finders/labels_finder.rb
@@ -35,13 +35,10 @@ class LabelsFinder < UnionFinder
end
def with_title(items)
- if title
- items.where(title: title)
- elsif params[:title] || params[:name] # empty input, should match nothing
- items.none
- else # not filtering
- items
- end
+ return items if title.nil?
+ return items.none if title.blank?
+
+ items.where(title: title)
end
def group_id
@@ -57,7 +54,7 @@ class LabelsFinder < UnionFinder
end
def title
- params[:title].presence || params[:name].presence
+ params[:title] || params[:name]
end
def project