filterer 1.0.0.beta.1 → 1.0.0.beta.2

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
2
  SHA1:
3
- metadata.gz: b44892d5a150d19bef25b69c217cf1fa0fa76cb7
4
- data.tar.gz: c8f02087f8d7ee437e936f841d23f9c2200f0462
3
+ metadata.gz: 14259ef77061c26e563a431f2aee2b43d4f0828c
4
+ data.tar.gz: 1f1c53649481c320639e4cb64fe2e01cbe3d33d8
5
5
  SHA512:
6
- metadata.gz: 3afe610c8e745b68f336a32078246cf94987a44803d8452384987acdd52886bfc4573ae33f146b12a1286e80deb901b487c15d37e8a671f4a302cd572e02f701
7
- data.tar.gz: 79ca8ab44c8d266eed187033a2fb22f4554695af64489a75afccbcdeaba78f77d1d8322ed769ca94444607db864e9abbc0176130a0d40f47296f02d804ea0810
6
+ metadata.gz: 7c64ec8f29c0f2e7d1f19388afa7dc4c5fc3e9bacc55a484647783106de139acdb677a950c42a3d6f85d86a7161c8baf77f4143d87e451656034513a64eba82f
7
+ data.tar.gz: 6da12838083832a22f23d841c022a91852998587cd83e19245805b424be2569a5dbd032f4f97411c51b6c013bc898e69cecf385c25326c9bb3e8dc778b5221d1
@@ -8,6 +8,11 @@ module Filterer
8
8
  filter(params, { starting_query: all }.merge(opts))
9
9
  end
10
10
 
11
+ def self.chain(params = {}, opts = {})
12
+ filterer_class(opts[:filterer_class]).
13
+ chain(params, { starting_query: all }.merge(opts))
14
+ end
15
+
11
16
  def self.filterer_class(override)
12
17
  if override
13
18
  override.constantize
data/lib/filterer/base.rb CHANGED
@@ -50,8 +50,16 @@ module Filterer
50
50
 
51
51
  # Public API
52
52
  # @return [ActiveRecord::Association]
53
- def filter(*args)
54
- new(*args).results
53
+ def filter(params = {}, opts = {})
54
+ new(params, opts).results
55
+ end
56
+
57
+ # @return [ActiveRecord::Association]
58
+ def chain(params = {}, opts = {})
59
+ new(params, opts.merge(
60
+ skip_ordering: true,
61
+ skip_pagination: true
62
+ )).results
55
63
  end
56
64
  end
57
65
 
@@ -1,3 +1,3 @@
1
1
  module Filterer
2
- VERSION = '1.0.0.beta.1'
2
+ VERSION = '1.0.0.beta.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: filterer
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.beta.1
4
+ version: 1.0.0.beta.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Becker