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.
@@ -44,7 +44,7 @@ class Search < ActiveRecord::Base
44
44
  end
45
45
 
46
46
  def normalize(column)
47
- if respond_to? "normalize_#{column}"
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 /([^[:alnum:]+])/, ' ' if text
61
+ text.gsub(/[^[:alnum:]]+/, ' ') if text
62
62
  end
63
63
 
64
64
  def klass
@@ -1,3 +1,3 @@
1
1
  module HasSearcher
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.4.1"
3
3
  end
metadata CHANGED
@@ -6,7 +6,8 @@ version: !ruby/object:Gem::Version
6
6
  - 0
7
7
  - 0
8
8
  - 4
9
- version: 0.0.4
9
+ - 1
10
+ version: 0.0.4.1
10
11
  platform: ruby
11
12
  authors:
12
13
  - Dmitry Lihachev