query_report 1.0.13 → 1.0.14

Sign up to get free protection for your applications and to get access to all the features.
@@ -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
@@ -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 = get_content_from_element(row[rowspan_col]) #picking the current content of the rowspan column
69
- prev_rowspan_content = get_content_from_element(prev_row[rowspan_col]) #picking the last rowspan content stored
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 = get_content_from_element(prev_row[col])
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 get_content_from_element(content)
94
+ def content_from_element(content)
95
95
  content.kind_of?(Hash) ? content[:content] : content
96
96
  end
97
97
  end
@@ -1,3 +1,3 @@
1
1
  module QueryReport
2
- VERSION = "1.0.13"
2
+ VERSION = "1.0.14"
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.13
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-30 00:00:00.000000000 Z
12
+ date: 2013-10-31 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails