query_report 1.0.13 → 1.0.14
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/lib/query_report/column.rb +1 -1
- data/lib/query_report/record.rb +4 -4
- data/lib/query_report/version.rb +1 -1
- metadata +2 -2
data/lib/query_report/column.rb
CHANGED
@@ -86,7 +86,7 @@ module QueryReport
|
|
86
86
|
end
|
87
87
|
|
88
88
|
def total
|
89
|
-
@total ||= has_total? ? report.records.inject(0) { |sum, r| sum + r[humanize].to_f } : nil
|
89
|
+
@total ||= has_total? ? report.records.inject(0) { |sum, r| sum + report.content_from_element(r[humanize]).to_f } : nil
|
90
90
|
end
|
91
91
|
end
|
92
92
|
end
|
data/lib/query_report/record.rb
CHANGED
@@ -65,11 +65,11 @@ module QueryReport
|
|
65
65
|
last_reset_index.each do |col, last_index|
|
66
66
|
rowspan_col = rowspan_column_hash[col]
|
67
67
|
|
68
|
-
rowspan_content =
|
69
|
-
prev_rowspan_content =
|
68
|
+
rowspan_content = content_from_element(row[rowspan_col]) #picking the current content of the rowspan column
|
69
|
+
prev_rowspan_content = content_from_element(prev_row[rowspan_col]) #picking the last rowspan content stored
|
70
70
|
|
71
71
|
content = row[col]
|
72
|
-
prev_content =
|
72
|
+
prev_content = content_from_element(prev_row[col])
|
73
73
|
|
74
74
|
if index == 0 || rowspan_content != prev_rowspan_content || content != prev_content
|
75
75
|
last_reset_index[col] = index
|
@@ -91,7 +91,7 @@ module QueryReport
|
|
91
91
|
end
|
92
92
|
end
|
93
93
|
|
94
|
-
def
|
94
|
+
def content_from_element(content)
|
95
95
|
content.kind_of?(Hash) ? content[:content] : content
|
96
96
|
end
|
97
97
|
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.14
|
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-
|
12
|
+
date: 2013-10-31 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|