mongoid-report 0.1.5 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NDE4Y2Y5ODExNDhkNTdmMWNlNzIwMTg1MWU0OTcwYWJlZTg0YTIzYw==
4
+ Nzk0NTgwOTk3NDY5NjYzNzQ4YjM5NmQ1NjVlNTI2ZGI1YTA0NDcwMg==
5
5
  data.tar.gz: !binary |-
6
- NzBhN2ZiY2RhMDhjOTcwZDA2ZjBkNjQ4NDEzN2I2MDZhNmVhZjZhOQ==
6
+ YjNjYmU3MjIxNzQxOGFlM2JlYzBjZjQ1OWNhYTM0MWNkMDc5ZjQyYw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MzY3ZDQ5ZTI2YjJmNmE4OWU2Y2JmZWRkMTkzMzYwNmQ0NzJlNGFjNGI3OTY4
10
- Mzc3MjBiNGE3ZjRiMTJjZDY3Nzk1NWFlNzBkMmM4YjA4YzM3MWM3NDQzMDhk
11
- MWRiMTRhMzNkZDg1NDk3ZjUxOTdiMDAxZWZkNmNiMGU0ZGZiOWY=
9
+ MGE2NTQ1M2EyYWQzYjcxMDZiNzFiNTM2YjJkYTAyMWI3NjJjMmZiYWVlYTdk
10
+ NDAxZjI0YWY3NWVmMzY2Zjc2N2ZiZDcyYmI5NzQ0NWQ0YjMwOTYyMzM2NWZm
11
+ NDc2Mzg5MTJlNGE4MjYyNWRmYTA4ZmMxMDE0OTRiMGI1NTNlOTY=
12
12
  data.tar.gz: !binary |-
13
- M2NkYmJlYTU0YjcyZmRhODE3OTY5Yjg0Y2MzMmRhYzU0NTc5YmVkZTc0M2Zh
14
- OWE4MWJjNWY5YjZkMjZkMGZmZGVkZTBkZjIwNzVjM2E4M2FhZTE1MjViYzhk
15
- NTAzYTU5NGJhYjY4MGRkYjA3ZTc5YmQ3NjdiOGFlZWRiZjk5OTc=
13
+ ODZhMDdjOTk2YWRkOGQyM2FkZTlhZTdiMzBiYzM5NmFjN2MzM2ZkNWI3NzJh
14
+ M2VlZmFkNjUzNmZlMGM5YzZiM2Q1YTkzOGZjYzNhZGNjN2MwMGIyNGEyZWVj
15
+ MzVmMDVlMTE1MWY0Njk1ZWVjNDg5ZGNmNTBmOTNiODcyYTgwNjA=
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- mongoid-report (0.1.5)
4
+ mongoid-report (0.1.6)
5
5
  mongoid (> 3.0.1)
6
6
 
7
7
  GEM
@@ -21,9 +21,14 @@ module Mongoid
21
21
  def summary
22
22
  @summary ||= reduce(Hash.new{|h, k| h[k] = 0}) do |summary, row|
23
23
  @fields.each do |field|
24
+ next if @columns.has_key?(field.to_s)
24
25
  summary[field] += row[field.to_s]
25
26
  end
26
27
 
28
+ @columns.each do |name, function|
29
+ summary[name] = function.call(@context, row)
30
+ end
31
+
27
32
  summary
28
33
  end.with_indifferent_access
29
34
  end
@@ -1,5 +1,5 @@
1
1
  module Mongoid
2
2
  module Report
3
- VERSION = "0.1.5"
3
+ VERSION = "0.1.6"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mongoid-report
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexandr Korsak
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-29 00:00:00.000000000 Z
11
+ date: 2014-06-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mongoid