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 +4 -4
- data/lib/filterer/active_record.rb +5 -0
- data/lib/filterer/base.rb +10 -2
- data/lib/filterer/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 14259ef77061c26e563a431f2aee2b43d4f0828c
|
4
|
+
data.tar.gz: 1f1c53649481c320639e4cb64fe2e01cbe3d33d8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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(
|
54
|
-
new(
|
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
|
|
data/lib/filterer/version.rb
CHANGED