active_scaffold_export 3.8.2 → 3.9.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2032f601f2b24c92f74206f77a2bea941fb4393bd1222f5279abaa3b934696b2
4
- data.tar.gz: fbade8c18c3dc2c3bca4ec594e6d77445468ac01368a7d170324d3a3efa0a555
3
+ metadata.gz: 270c47817326448305acea738088f43e9fc7bd0b1ae0283915feb8fde4b8a478
4
+ data.tar.gz: b23ae05c9749d8708568b15eb2b4a44f02f59ecd23df0a57a76e46481300655e
5
5
  SHA512:
6
- metadata.gz: abbb6f97276df4ea8cdfa82230b8aa3c298561e9d231e4fb2ccf2bea643ff376be243d366428d1aab9d9391918be913e6b47fe4ffa95ef4e68da388b6b16011d
7
- data.tar.gz: d844e06ed11f8f44d51f959380dbd2da935abebac67f7195ecf9e67fd63aacf4f14c7e1e7267b922e804de62ca1babd05b01143cff416465de93317edaec595c
6
+ metadata.gz: 2b6f90a0ed3d81463a12d3b62d35c65ac03cc09d0d0754f666441948f9e259f149778660213948d691f200f235192ad16f01859b5c0b5f9d557d613864e3f06e
7
+ data.tar.gz: 365fc9c8d0ad96bd8f577ec4959dc8fa4b97aa9cf7f16886d96833604b475a3ae38f47c48a7c93cfee0e2e6c9c6fc2d7bf08b37bce635ee32e699c13d45a201e
data/README.md CHANGED
@@ -7,21 +7,19 @@ Then, add this to your Gemfile:
7
7
  ```
8
8
  gem 'active_scaffold_export'
9
9
  ```
10
- if you're using REE or Ruby 1.8.7, you need to add backports gem as well as fastercsv since REE lacks ruby 1.9 streaming features and fastercsv is in core in 1.9
11
- ```
12
- gem 'backports'
13
- gem 'fastercsv'
14
- ```
15
- if you want xlsx format, add:
10
+
11
+ If you want xlsx format, add:
16
12
  ```
17
13
  gem 'caxlsx_rails'
18
14
  ```
19
- if that gem is present, XLSX will be used by default.
15
+
16
+ If that gem is present, XLSX will be used by default.
20
17
  You can change this by adding to active scaffold config:
21
18
  ```
22
19
  conf.export.default_file_format = 'csv' # or 'xlsx'
23
20
  ```
24
- read important notes at the bottom about xlsx.
21
+
22
+ Read important notes at the bottom about xlsx.
25
23
 
26
24
  Remember to bundle install.
27
25
  Add to application.css:
@@ -1,10 +1,9 @@
1
1
  <% export_config = active_scaffold_config.export %>
2
2
  <h3><%=as_(:columns_for_export)%></h3>
3
- <% if ActiveScaffold.js_framework == :jquery # TODO: use JS asset instead of inline JS %>
3
+ <%# TODO: use JS asset instead of inline JS %>
4
4
  <%= link_to as_(:select_all), '#', onclick: 'jQuery(".columnCheckbox").prop("checked", true); return false', class: 'active-scaffold-footer' %>
5
5
  |
6
6
  <%= link_to as_(:select_none), '#', onclick: 'jQuery(".columnCheckbox").prop("checked", false); return false', class: 'active-scaffold-footer' %>
7
- <% end %>
8
7
  <div class="columns checkbox-list">
9
8
  <% export_config.columns.each_column do |column| -%>
10
9
  <div class="column checkbox-wrapper">
@@ -12,10 +12,10 @@ module ActiveScaffold
12
12
  def get_export_column_value(record, column, format)
13
13
  if (method = export_column_override(column))
14
14
  value, options = send(method, record, format)
15
- [value, options || column.export_options&.dig(format)]
15
+ [value, options || export_column_style(column, format)]
16
16
  elsif column.list_ui && (method = override_export_ui(column.list_ui))
17
17
  value, options = send(method, record, column, format, ui_options: column.list_ui_options || column.options)
18
- [value, options || column.export_options&.dig(format)]
18
+ [value, options || export_column_style(column, format)]
19
19
  else
20
20
  raw_value = record.send(column.name)
21
21
 
@@ -29,10 +29,15 @@ module ActiveScaffold
29
29
  format_singular_association_export_column(raw_value, format)
30
30
  end
31
31
  end
32
- [value, column.export_options&.dig(format)]
32
+ [value, export_column_style(column, format)]
33
33
  end
34
34
  end
35
35
 
36
+ def export_column_style(column, format)
37
+ style = column.export_options&.dig(format)
38
+ format = :xlsx && style.frozen? ? style.deep_dup : style
39
+ end
40
+
36
41
  def export_column_override(column)
37
42
  override_helper column, 'export_column'
38
43
  end
@@ -1,8 +1,8 @@
1
1
  module ActiveScaffoldExport
2
2
  module Version
3
3
  MAJOR = 3
4
- MINOR = 8
5
- PATCH = 2
4
+ MINOR = 9
5
+ PATCH = 1
6
6
 
7
7
  STRING = [MAJOR, MINOR, PATCH].compact.join('.')
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_scaffold_export
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.8.2
4
+ version: 3.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Volker Hochstein
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2024-11-21 00:00:00.000000000 Z
13
+ date: 2025-02-23 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: active_scaffold
@@ -18,14 +18,14 @@ dependencies:
18
18
  requirements:
19
19
  - - ">="
20
20
  - !ruby/object:Gem::Version
21
- version: 3.7.1
21
+ version: 4.0.0.rc1
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
26
  - - ">="
27
27
  - !ruby/object:Gem::Version
28
- version: 3.7.1
28
+ version: 4.0.0.rc1
29
29
  description: Exporting Records with ActiveScaffold
30
30
  email: activescaffold@googlegroups.com
31
31
  executables: []
@@ -69,7 +69,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
69
69
  - !ruby/object:Gem::Version
70
70
  version: '0'
71
71
  requirements: []
72
- rubygems_version: 3.2.3
72
+ rubygems_version: 3.5.11
73
73
  signing_key:
74
74
  specification_version: 4
75
75
  summary: Ability to export records to CSV/XLSX with ActiveScaffold