has_searcher 0.0.4 → 0.0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/app/models/search.rb +2 -2
- data/lib/has_searcher/version.rb +1 -1
- metadata +2 -1
data/lib/app/models/search.rb
CHANGED
@@ -44,7 +44,7 @@ class Search < ActiveRecord::Base
|
|
44
44
|
end
|
45
45
|
|
46
46
|
def normalize(column)
|
47
|
-
if respond_to?
|
47
|
+
if column != "term" && respond_to?("normalize_#{column}")
|
48
48
|
send "normalize_#{column}"
|
49
49
|
elsif self.class.serialized_attributes[column] == Array
|
50
50
|
[*self.send("#{column}_before_type_cast")].select(&:present?)
|
@@ -58,7 +58,7 @@ class Search < ActiveRecord::Base
|
|
58
58
|
end
|
59
59
|
|
60
60
|
def normalize_term(text)
|
61
|
-
text.gsub
|
61
|
+
text.gsub(/[^[:alnum:]]+/, ' ') if text
|
62
62
|
end
|
63
63
|
|
64
64
|
def klass
|
data/lib/has_searcher/version.rb
CHANGED