From 3ea4cfb4fe7ffbdb0338cd7a538222537c741608 Mon Sep 17 00:00:00 2001 From: Robin Steiner Date: Fri, 24 May 2024 11:43:08 +0200 Subject: [PATCH] Don't include trailing whitespaces for skillset search --- app/controllers/skills_controller.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/controllers/skills_controller.rb b/app/controllers/skills_controller.rb index d375f3b85..6ec3f23f2 100644 --- a/app/controllers/skills_controller.rb +++ b/app/controllers/skills_controller.rb @@ -51,6 +51,7 @@ def fetch_entries parent_category: [:children, :parent], category: [:children, :parent]).list end + SkillsFilter.new(entries, params[:category], params[:title], params[:defaultSet]).scope end @@ -60,7 +61,10 @@ def disposition def entries @skills = - SkillsFilter.new(Skill.all, params[:category], params[:title], params[:defaultSet]).scope + SkillsFilter.new(Skill.all, + params[:category], + params[:title]&.strip, + params[:defaultSet]).scope end # rubocop:disable Metrics/AbcSize