active_report 5.2.5 → 5.2.6

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
  SHA256:
3
- metadata.gz: 4614fb70725ffd6adc4aa06ee4cd5d2f8c4034918b10a1ecb418bd91c97e8b52
4
- data.tar.gz: 6f1142d465a1a27aa01c8f1270fdcf2c7dc06a7cb87e209190458c59c4588a18
3
+ metadata.gz: a9e4cbb42e5657ad07cf960f5b6eb511f5a9bf8849a4da2186df559e0d7b834e
4
+ data.tar.gz: 4f067fb60f4258ac44a45be3467ec20be895c9e0e12278c28df3c6b8a205fa80
5
5
  SHA512:
6
- metadata.gz: 0256bac113ce460cbf0c91216748fad24c9bd11236ff4addda8412e5fdd4efcd2deb89d44a8c13b3d3dd001a789e8545ad3e037a0ed6aa0fca40158e5b08433d
7
- data.tar.gz: 6c13b9e78217c38f629964df0c788a5fb66c4045da249bf92c5706c76f51239d072c88de2f4d94de85f2a339eeb482fa7a70acd484b5e0180cf83e6b89a6e8d2
6
+ metadata.gz: 8f0ca6edd0b24691e27a6da356dbc853774225fe92708b8299b9f84970148d7c5fa62565e630d6fb8082a809a2a32248e0ee607a390a426cdc8ecba3c0780588
7
+ data.tar.gz: 86218db0fe6b563a9b61144502dfd45884f17a47fd902887a766337f7d55b0fceca498ecaf172098b6ad3db3ca159bad1145044c3afae0402204972233f5b5cd
@@ -55,6 +55,11 @@ class ActiveReport::Base
55
55
  object.respond_to?(:table_name) || object.is_a?(Ransack::Search)
56
56
  end
57
57
 
58
+ def active_record_column_names(object)
59
+ return object.klass.column_names if object.is_a?(Ransack::Search)
60
+ object.column_names
61
+ end
62
+
58
63
  def encode_to_utf8(line)
59
64
  line.map do |chr|
60
65
  next if chr.nil?
@@ -11,7 +11,7 @@ class ActiveReport::Record < ActiveReport::Base
11
11
  %i[except only].each { |key| @opts[key] = @opts[key].map(&:to_s) }
12
12
 
13
13
  if active_record_table_class?(@data)
14
- @opts[:headers] = (@opts[:headers] || humanize_values(@data.column_names))
14
+ @opts[:headers] = (@opts[:headers] || humanize_values(active_record_column_names(@data)))
15
15
 
16
16
  @opts[:stream] ? export_stream : export_csv
17
17
  else
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ActiveReport
4
- VERSION ||= '5.2.5'
4
+ VERSION ||= '5.2.6'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_report
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.2.5
4
+ version: 5.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juan Gomez