Skip to content

A platform for community discussion. Free, open, simple.

REFACTOR: compact! works since the array can't contain empty strings

Gerhard Schlagerbf27aecce25c
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