filterer 0.3.3 → 0.3.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/filterer/base.rb +7 -0
- data/lib/filterer/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4a138d652fabbc12e24e17721a99cd126ae35591
|
4
|
+
data.tar.gz: 4d651ac67a3d09a90a4a198abdc2e6b860c8e8d7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e9accb1c92193354c204b89585a6ba6d75642b9613573acba6dce924bc76ccb4c968b8d3ce5ab4853bc02a0265c858078c282291ad74566e25d5e23fb453096b
|
7
|
+
data.tar.gz: 0cba437c9e6e9a896987c2d927a145c14bd5c989f54db85042915f0c8d86f902a17aeff08e2945ba5c6fc21ca69d5b252518022e60d48bb66246df53c493faac
|
data/lib/filterer/base.rb
CHANGED
@@ -83,6 +83,8 @@ module Filterer
|
|
83
83
|
# Add params
|
84
84
|
add_params_to_query
|
85
85
|
|
86
|
+
return if @opts[:chainable]
|
87
|
+
|
86
88
|
# Order results
|
87
89
|
order_results
|
88
90
|
|
@@ -158,5 +160,10 @@ module Filterer
|
|
158
160
|
return filterer.meta[:total]
|
159
161
|
end
|
160
162
|
|
163
|
+
def self.chain(params = {}, opts = {})
|
164
|
+
filterer = self.new(params, { chainable: true }.merge(opts))
|
165
|
+
return filterer.results
|
166
|
+
end
|
167
|
+
|
161
168
|
end
|
162
169
|
end
|
data/lib/filterer/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: filterer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Becker
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-10-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -188,3 +188,4 @@ signing_key:
|
|
188
188
|
specification_version: 4
|
189
189
|
summary: Easily filter results from your ActiveRecord models.
|
190
190
|
test_files: []
|
191
|
+
has_rdoc:
|