active-list 4.1.8 → 4.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/active-list/exporters.rb +2 -2
- data/lib/active-list/exporters/excel_csv_exporter.rb +8 -8
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
4.
|
1
|
+
4.2.0
|
@@ -38,7 +38,7 @@ module ActiveList
|
|
38
38
|
headers, columns = [], table.exportable_columns
|
39
39
|
for column in columns
|
40
40
|
datum = column.header_code
|
41
|
-
headers << (options[:
|
41
|
+
headers << (options[:encoding] ? datum+".to_s.encode('#{options[:encoding]}')" : datum)
|
42
42
|
end
|
43
43
|
return headers
|
44
44
|
end
|
@@ -55,7 +55,7 @@ module ActiveList
|
|
55
55
|
else
|
56
56
|
datum = column.exporting_datum_code(record)
|
57
57
|
end
|
58
|
-
array << (options[:
|
58
|
+
array << (options[:encoding] ? datum+".to_s.encode('#{options[:encoding]}')" : datum)
|
59
59
|
end
|
60
60
|
end
|
61
61
|
return array
|
@@ -18,14 +18,14 @@ module ActiveList
|
|
18
18
|
def send_data_code(table)
|
19
19
|
record = "r"
|
20
20
|
code = table.select_data_code(:paginate => false)
|
21
|
-
|
22
|
-
code
|
23
|
-
code
|
24
|
-
code
|
25
|
-
code
|
26
|
-
code
|
27
|
-
code
|
28
|
-
code
|
21
|
+
encoding = "CP1252"
|
22
|
+
code << "data = ActiveList::CSV.generate(:col_sep=>';') do |csv|\n"
|
23
|
+
code << " csv << [#{columns_to_array(table, :header, :encoding => '#{encoding}').join(', ')}]\n"
|
24
|
+
code << " for #{record} in #{table.records_variable_name}\n"
|
25
|
+
code << " csv << [#{columns_to_array(table, :body, :record=>record, :encoding => '#{encoding}').join(', ')}]\n"
|
26
|
+
code << " end\n"
|
27
|
+
code << "end\n"
|
28
|
+
code << "send_data(data, :type => #{self.mime_type.to_s.inspect}, :disposition => 'inline', :filename => #{table.model.name}.model_name.human.gsub(/[^a-z0-9]/i,'_')+'.#{self.file_extension}')\n"
|
29
29
|
return code
|
30
30
|
end
|
31
31
|
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: active-list
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
version: !binary |-
|
5
|
-
|
5
|
+
NC4yLjA=
|
6
6
|
prerelease:
|
7
7
|
platform: ruby
|
8
8
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2013-
|
13
|
+
date: 2013-02-19 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rails
|