query_report 1.0.10 → 1.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.md CHANGED
@@ -1,6 +1,7 @@
1
- [Query report](http://ashrafuzzaman.github.io/query_report/) By [Ashrafuzzaman](http://ashrafuzzaman.github.io/site).
1
+ [Query report](http://ashrafuzzaman.github.io/query_report/) By [Ashrafuzzaman](http://ashrafuzzaman.github.io).
2
2
 
3
3
  [![Build Status](https://api.travis-ci.org/ashrafuzzaman/query_report.png?branch=master)](http://travis-ci.org/ashrafuzzaman/query_report)
4
+ [![Gem Version](https://badge.fury.io/rb/query_report.png)](http://badge.fury.io/rb/query_report)
4
5
 
5
6
  Query report is a reporting tool, which does the following:
6
7
 
@@ -20,7 +21,7 @@ concentrate in a report is the query and filter.
20
21
  Query report is tested with Rails 3. You can add it to your Gemfile with:
21
22
 
22
23
  ```ruby
23
- gem "query_report", "~> 1.0.4"
24
+ gem "query_report"
24
25
  ```
25
26
 
26
27
  Run the bundle command to install it.
@@ -54,4 +55,4 @@ end
54
55
  ```
55
56
 
56
57
  ## License
57
- MIT License. Copyright © 2013 [Ashrafuzzaman](http://ashrafuzzaman.github.io/site). See MIT-LICENSE for further details.
58
+ MIT License. Copyright © 2013 [Ashrafuzzaman](http://ashrafuzzaman.github.io). See MIT-LICENSE for further details.
@@ -69,7 +69,7 @@ module QueryReport
69
69
  end
70
70
 
71
71
  def value(record)
72
- self.data.kind_of?(Symbol) ? record.send(self.name) : self.data.call(record)
72
+ self.data.kind_of?(Symbol) ? (record.respond_to?(self.name) ? record.send(self.name) : record[self.name]) : self.data.call(record)
73
73
  end
74
74
 
75
75
  def has_total?
@@ -77,7 +77,7 @@ module QueryReport
77
77
  end
78
78
 
79
79
  def total
80
- @total ||= has_total? ? report.records.inject(0) {|sum, r| sum + r[humanize] } : nil
80
+ @total ||= has_total? ? report.records.inject(0) {|sum, r| sum + (r[humanize].nil? ? 0 : r[humanize]) } : nil
81
81
  end
82
82
  end
83
83
  end
@@ -1,3 +1,3 @@
1
1
  module QueryReport
2
- VERSION = "1.0.10"
2
+ VERSION = "1.0.11"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: query_report
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.10
4
+ version: 1.0.11
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-10-09 00:00:00.000000000 Z
12
+ date: 2013-10-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails