query_report 1.0.17 → 1.0.18
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/query_report/column.rb +14 -1
- data/lib/query_report/version.rb +1 -1
- metadata +2 -2
data/lib/query_report/column.rb
CHANGED
@@ -44,6 +44,8 @@ module QueryReport
|
|
44
44
|
end
|
45
45
|
|
46
46
|
class Column
|
47
|
+
include ActionView::Helpers::SanitizeHelper
|
48
|
+
|
47
49
|
attr_reader :report, :name, :options, :type, :data
|
48
50
|
|
49
51
|
def initialize(report, column_name, options={}, block = nil)
|
@@ -90,8 +92,19 @@ module QueryReport
|
|
90
92
|
end
|
91
93
|
|
92
94
|
def total
|
93
|
-
@total ||=
|
95
|
+
@total ||= begin
|
96
|
+
if has_total?
|
97
|
+
report.records_with_rowspan.inject(0) do |sum, r|
|
98
|
+
r = report.content_from_element(r[humanize])
|
99
|
+
r = strip_tags(r) if r.kind_of? String
|
100
|
+
sum + r.to_f
|
101
|
+
end
|
102
|
+
else
|
103
|
+
nil
|
104
|
+
end
|
105
|
+
end
|
94
106
|
end
|
107
|
+
|
95
108
|
end
|
96
109
|
end
|
97
110
|
end
|
data/lib/query_report/version.rb
CHANGED
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.
|
4
|
+
version: 1.0.18
|
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-
|
12
|
+
date: 2013-12-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|