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 +4 -4
- data/lib/active_report/base.rb +5 -0
- data/lib/active_report/record.rb +1 -1
- data/lib/active_report/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a9e4cbb42e5657ad07cf960f5b6eb511f5a9bf8849a4da2186df559e0d7b834e
|
4
|
+
data.tar.gz: 4f067fb60f4258ac44a45be3467ec20be895c9e0e12278c28df3c6b8a205fa80
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8f0ca6edd0b24691e27a6da356dbc853774225fe92708b8299b9f84970148d7c5fa62565e630d6fb8082a809a2a32248e0ee607a390a426cdc8ecba3c0780588
|
7
|
+
data.tar.gz: 86218db0fe6b563a9b61144502dfd45884f17a47fd902887a766337f7d55b0fceca498ecaf172098b6ad3db3ca159bad1145044c3afae0402204972233f5b5cd
|
data/lib/active_report/base.rb
CHANGED
@@ -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?
|
data/lib/active_report/record.rb
CHANGED
@@ -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
|
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
|