like_search 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,3 @@
1
1
  module LikeSearch
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
data/lib/like_search.rb CHANGED
@@ -8,6 +8,8 @@ module LikeSearch
8
8
  }
9
9
  DB.default = "{field} like ?"
10
10
 
11
+
12
+
11
13
  extend ActiveSupport::Concern
12
14
 
13
15
  module ClassMethods
@@ -28,9 +30,9 @@ module LikeSearch
28
30
  end
29
31
  end
30
32
 
31
- def token_search(query)
33
+ def token_search(query, token_size=2)
32
34
  query.to_s.split.inject(scoped) do |current_scope, term|
33
- term.size > 3 ? current_scope.search(term) : current_scope
35
+ term.size > token_size ? current_scope.search(term) : current_scope
34
36
  end
35
37
  end
36
38
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: like_search
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: