simple_searchable 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: d07f09bcd6be2d696361577ec3aba42f9ce290c2
4
- data.tar.gz: 702622cc97bd72ce5ef8e2f5b10196374bb71ded
2
+ SHA256:
3
+ metadata.gz: 1d3020aac43ae13fb33ab6f44c1d9f229b69ebfd1fad8972a425377568457639
4
+ data.tar.gz: 9f82455b3d396362c5ba07d5842b29c0041dec6d110c8cd08caf2c2e28c86238
5
5
  SHA512:
6
- metadata.gz: 27bf6590e2b6f9550b06eb15a07339053c962225353434543b9936534d948e7542bb22580b3e03bc00d03cdf9a5ebbf45018a5266fd4cf4fee92fb25fcc4cd5c
7
- data.tar.gz: 10e6740913c3c25b339fa8eaf11a99b1d10a59acc8234ffa069f8452151dfa386961f95356bfcc56b780f01c51461430150651bd98e5bcb9ccc7a5cd208721dc
6
+ metadata.gz: dc43b4ba70c43f9311536faf23ec1f764a5a73ebc826094d4e413176556545c8714932e549a0c5c1d4988192a1f7cc0a406290dc9a39e0e634e7631ed17f71a1
7
+ data.tar.gz: cf465e33ccc49c43f8106ede96e1884f654a998a3bc3324579bc7e4a914fe17784e5d486a325f0af9589d865336737a084ce49d2ba4559c715a460e42f8cd556
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # SimpleSearchable
2
2
 
3
- This gem adds the utility methods for a basic ActiveRecord search/filtering pattern explained [here](http://www.wordofmike.net/j/easy-active-record-search-pattern).
3
+ This gem adds the utility methods for a basic ActiveRecord search/filtering pattern.
4
4
 
5
5
  ## Installation
6
6
 
@@ -6,23 +6,23 @@ module SimpleSearchable
6
6
  self.singleton_class.send(:define_method, :search) do |opts|
7
7
  return all if opts.nil?
8
8
 
9
- filter_all(method_names, opts)
9
+ search_filter_all(method_names, opts)
10
10
  end
11
11
 
12
12
  self.send(:extend, FilterMethods)
13
13
  end
14
14
 
15
15
  module FilterMethods
16
- def filter(name, arg)
16
+ def search_filter(name, arg)
17
17
  arg.present? ? send(name, arg) : all
18
18
  end
19
19
 
20
- def filter_all(names, opts)
20
+ def search_filter_all(names, opts)
21
21
  result = self.all
22
22
  names.each do |n|
23
23
  unless opts[n].blank?
24
24
  opts[n].reject!(&:blank?) if opts[n].is_a?(Array)
25
- result = result.filter(n, opts[n])
25
+ result = result.search_filter(n, opts[n])
26
26
  end
27
27
  end
28
28
  result
@@ -31,4 +31,4 @@ module SimpleSearchable
31
31
  end
32
32
  end
33
33
 
34
- ActiveRecord::Base.send(:extend, SimpleSearchable::SearchableBy)
34
+ ActiveRecord::Base.send(:extend, SimpleSearchable::SearchableBy)
@@ -1,3 +1,3 @@
1
1
  module SimpleSearchable
2
- VERSION = "1.0.0"
2
+ VERSION = "1.1.0"
3
3
  end
metadata CHANGED
@@ -1,35 +1,35 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_searchable
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Campbell
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-07-20 00:00:00.000000000 Z
11
+ date: 2019-03-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "<"
18
- - !ruby/object:Gem::Version
19
- version: '6'
20
17
  - - ">="
21
18
  - !ruby/object:Gem::Version
22
19
  version: '4.0'
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '6'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
- - - "<"
28
- - !ruby/object:Gem::Version
29
- version: '6'
30
27
  - - ">="
31
28
  - !ruby/object:Gem::Version
32
29
  version: '4.0'
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '6'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: bundler
35
35
  requirement: !ruby/object:Gem::Requirement
@@ -93,7 +93,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
93
93
  version: '0'
94
94
  requirements: []
95
95
  rubyforge_project:
96
- rubygems_version: 2.5.1
96
+ rubygems_version: 2.7.8
97
97
  signing_key:
98
98
  specification_version: 4
99
99
  summary: A very simple ActiveRecord search pattern