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 +4 -4
- data/lib/query_report/column.rb +4 -2
- data/lib/query_report/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9649f6be20fc5cd8738ca521df3292f762398f4d
|
4
|
+
data.tar.gz: 92ee7890ccc3dffd1b3459249836b5277569d8b5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: da856c57641e50b79d0dfdd157e32e21cdeff72996ed4ef7667454e6c8136a202b7a950e490a5f765a3ce3ca94538a994249ba5452dde0abf2cfb44420c1b3b4
|
7
|
+
data.tar.gz: 150e0e2686222fe56516b04a9a53cfdb5a9450e32cef85761b6c4869ccd049b53f944aa9e96500fe20e7cd4deb68e3185908497b8596dad69cce22fc68038581
|
data/lib/query_report/column.rb
CHANGED
@@ -152,11 +152,13 @@ module QueryReport
|
|
152
152
|
def total
|
153
153
|
@total ||= begin
|
154
154
|
if has_total?
|
155
|
-
|
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
|
data/lib/query_report/version.rb
CHANGED