From bf27aecce25c2b8267312045b93b511dd5eb3b92 Mon Sep 17 00:00:00 2001 From: Gerhard Schlager Date: Thu, 22 Nov 2018 13:27:34 +0100 Subject: [PATCH] REFACTOR: compact! works since the array can't contain empty strings --- lib/search.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/search.rb b/lib/search.rb index dd41ed9db45..e26f8c29f15 100644 --- a/lib/search.rb +++ b/lib/search.rb @@ -833,7 +833,7 @@ class Search all_terms = data.scan(/'([^']+)'\:\d+/).flatten all_terms.map! do |t| t.split(/[\)\(&']/).find(&:present?) - end.reject!(&:blank?) + end.compact! query = ActiveRecord::Base.connection.quote( all_terms