filternator 0.0.2 → 0.0.3

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: a9532beae77803dc540e0aea17cd94c59f249012
4
- data.tar.gz: b640afec728316cae2a4e9494770a4cbdbddc68b
3
+ metadata.gz: 580bcc844e002308ce04d4d7d065b55be8502a93
4
+ data.tar.gz: ccfa34d6d51b92828046475068553c35c605f07a
5
5
  SHA512:
6
- metadata.gz: ef551844012da8879baacad9ba6afa518acbca0860e813cad34edca68b6a7492efd02ed32098d330d14a411c4e6d7101c292ecbf88b58bfa85bb89de37d3f307
7
- data.tar.gz: 47e44181a00ef9e7b89a8f51aa6fcc14556beb3d4f06edfa843fa1bcee3d17f9a5c43e257d9e1659eceec9f446f96bf7061119db5e4d2ed652afc82c517097c7
6
+ metadata.gz: 48bf7cb13193cad57d1c80c5fa958756b8b591eaa7f70f440d2fc24cbe8d0af1f80a26053a2448c658535672f21bd86181b6bc41091fb9d499a88bf361b3dcfe
7
+ data.tar.gz: 6aea328ce4c15f04752de860b85a5db93a819e917c68085be1ab666451ec79164c43c15f6996b661d602f7387cd07c72695a3c73b72912423847bf8fd837f152
@@ -12,7 +12,12 @@ module Filternator
12
12
  end
13
13
 
14
14
  def stats
15
- Hash[ all_filters.map { |filter| [ filter, apply(filter: filter).count ] } ]
15
+ pairs = all_filters.map { |filter|
16
+ result = apply(filter: filter).count
17
+ result = result.keys.first if result.is_a?(Hash) # ActiveRecord `group by` fix
18
+ [ filter, result ]
19
+ }
20
+ Hash[pairs]
16
21
  end
17
22
 
18
23
  def apply(params)
@@ -1,3 +1,3 @@
1
1
  module Filternator
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: filternator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - iain
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-09-03 00:00:00.000000000 Z
11
+ date: 2013-11-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -135,7 +135,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
135
135
  version: '0'
136
136
  requirements: []
137
137
  rubyforge_project:
138
- rubygems_version: 2.0.3
138
+ rubygems_version: 2.1.0
139
139
  signing_key:
140
140
  specification_version: 4
141
141
  summary: A very basic gem for generating JSON responses for collections.