query_report 1.2.0 → 1.2.1

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: 5ce02cd7debc185a658c3dbfb5e94dbdfc2e9d4c
4
- data.tar.gz: 517bdde0743ffa34f3c5d72301f5e4b002c677d7
3
+ metadata.gz: 9649f6be20fc5cd8738ca521df3292f762398f4d
4
+ data.tar.gz: 92ee7890ccc3dffd1b3459249836b5277569d8b5
5
5
  SHA512:
6
- metadata.gz: e0980f847f2aed410c2e2224f1de2429c95fcacb3eb57ac6b32f75c0651e0bf45a5efe2841d2a4b2dc4631fde9988f3a551dc2403f67925e1301b9a29806a996
7
- data.tar.gz: 3f22e626b4e4f3ae13f2c6d6b9be0b44c06f39093790d7170fb71c8195677c1b738ce1d3ce69073d2890448afb1d7bdb3022f1b3e031480b3b379d236b6c5c17
6
+ metadata.gz: da856c57641e50b79d0dfdd157e32e21cdeff72996ed4ef7667454e6c8136a202b7a950e490a5f765a3ce3ca94538a994249ba5452dde0abf2cfb44420c1b3b4
7
+ data.tar.gz: 150e0e2686222fe56516b04a9a53cfdb5a9450e32cef85761b6c4869ccd049b53f944aa9e96500fe20e7cd4deb68e3185908497b8596dad69cce22fc68038581
@@ -152,11 +152,13 @@ module QueryReport
152
152
  def total
153
153
  @total ||= begin
154
154
  if has_total?
155
- report.records_to_render.inject(0) do |sum, r|
155
+ sum = 0
156
+ report.records_to_render.each do |r|
156
157
  r = report.content_from_element(r[humanize])
157
158
  r = strip_tags(r) if r.kind_of? String
158
- sum + r.to_f
159
+ sum = sum + r.to_f
159
160
  end
161
+ sum.kind_of?(Float) ? sum.round(2) : sum
160
162
  else
161
163
  nil
162
164
  end
@@ -1,3 +1,3 @@
1
1
  module QueryReport
2
- VERSION = "1.2.0"
2
+ VERSION = "1.2.1"
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.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - A.K.M. Ashrafuzzaman