active_scaffold_export 3.10.0 → 3.10.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3129ecc7a827c1e0f9d4052d2661751d8ed18124dd041b616694b6b74edfc511
|
4
|
+
data.tar.gz: 03d88fa2f813a8b841aa64f5de94439d7c4392e30e729641dc2f46076741d35b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 50b9a7a2e813c0526da48a17c2dc72ed8ce72cdadc4618e30b832ba48a7913c94e211f34954c5c16e67b1b655a5b96d8b1219fa23d028420bb15b5f34e39d625
|
7
|
+
data.tar.gz: b45b8846a4ccae25bea17e4eda5573931f6346b913ff16029b09bac721b82f90c77911085b0e76133584ff6920160d97414be02394c0a191286fdab53623df01
|
data/README.md
CHANGED
@@ -71,5 +71,11 @@ def worksheet_name(options = {})
|
|
71
71
|
end
|
72
72
|
```
|
73
73
|
|
74
|
+
### Grouped search
|
75
|
+
|
76
|
+
Export supports grouped search from field_search action. When grouped search is used, instead of exporting the normal columns, only the listed columns will be exported, the ones in `conf.list.columns` with calculation, or the ones in `conf.field_search.grouped_columns`. In this case, the normal helper overrides won't be used, and will use `grouped_export_column` suffix instead.
|
77
|
+
|
78
|
+
## Contact
|
79
|
+
|
74
80
|
For contact, help, support, comments, please use Active Scaffold official mailing list activescaffold@googlegroups.com
|
75
81
|
|
@@ -12,7 +12,7 @@
|
|
12
12
|
csv << fcsv_options[:headers] unless params[:skip_header]
|
13
13
|
@records.each do |record|
|
14
14
|
csv << @export_columns.collect { |column|
|
15
|
-
get_export_column_value(record, column, :csv)
|
15
|
+
get_export_column_value(record, column, :csv)&.first
|
16
16
|
}
|
17
17
|
end
|
18
18
|
end
|
@@ -113,7 +113,10 @@ module ActiveScaffold::Actions
|
|
113
113
|
|
114
114
|
def export_columns
|
115
115
|
return @export_columns if defined? @export_columns
|
116
|
-
@export_columns = export_columns_names.reject
|
116
|
+
@export_columns = export_columns_names.reject do |col|
|
117
|
+
params[:export_columns][col.to_sym].nil? ||
|
118
|
+
!active_scaffold_config.model.authorized_for?(crud_type: :read, column: col.to_sym)
|
119
|
+
end
|
117
120
|
sorting = active_scaffold_config.list.user.sorting || active_scaffold_config.list.sorting
|
118
121
|
sorting_columns = sorting.reject { |col, _| @export_columns.include?(col.name) }.map(&:first)
|
119
122
|
@export_columns.map! { |col| active_scaffold_config.columns[col] }
|
@@ -10,6 +10,7 @@ module ActiveScaffold
|
|
10
10
|
# format_singular_association_export_column(association_record)
|
11
11
|
# format_plural_association_export_column(association_records)
|
12
12
|
def get_export_column_value(record, column, format)
|
13
|
+
return unless record.authorized_for?(crud_type: :read, column: column.name)
|
13
14
|
if (method = export_column_override(column))
|
14
15
|
value, options = send(method, record, format)
|
15
16
|
[value, options || export_column_style(column, format)]
|
@@ -37,7 +38,7 @@ module ActiveScaffold
|
|
37
38
|
|
38
39
|
def export_column_style(column, format)
|
39
40
|
style = column.export_options&.dig(format)
|
40
|
-
format
|
41
|
+
format == :xlsx && style.frozen? ? style.deep_dup : style
|
41
42
|
end
|
42
43
|
|
43
44
|
def export_column_override(column)
|
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.10.
|
4
|
+
version: 3.10.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: 2025-
|
13
|
+
date: 2025-06-26 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: active_scaffold
|