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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f5dce29419208f6f36ab661bf59650cda29e2c9b
4
- data.tar.gz: 177654016dad7a672163d0201de485a7ba30ca52
3
+ metadata.gz: 4a138d652fabbc12e24e17721a99cd126ae35591
4
+ data.tar.gz: 4d651ac67a3d09a90a4a198abdc2e6b860c8e8d7
5
5
  SHA512:
6
- metadata.gz: 64652ccbc8884a62591cf964a66bbe02248b73da03a833cd0cf61084255220a5bf2100d823f75e6b7cf3b25bf758df6283c0fb06de57df12ca44511b820fa2ac
7
- data.tar.gz: 6233055bd08dd0a5273f981028cce60f4976233fdbc2ec2b30161b4dc94a0c201506dcf0c9315284b365ed5f79181eed8accae46e86fcd53b0140f88ba8fd031
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
@@ -1,3 +1,3 @@
1
1
  module Filterer
2
- VERSION = "0.3.3"
2
+ VERSION = "0.3.4"
3
3
  end
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.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-04-14 00:00:00.000000000 Z
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: