Commit 5b2617e5 by liyijie

fix: export_association_headers array convert

parent 391a274d
...@@ -69,7 +69,9 @@ module TalltyImportExport ...@@ -69,7 +69,9 @@ module TalltyImportExport
if respond_to?(:export_association_headers) if respond_to?(:export_association_headers)
records.each do |record| records.each do |record|
context.record = record context.record = record
Array(export_association_headers(**options)).each do |association_headers| _export_association_headers = export_association_headers(**options)
_export_association_headers = _export_association_headers.is_a?(Array) ? _export_association_headers : [_export_association_headers]
_export_association_headers.each do |association_headers|
association_headers.with_indifferent_access! association_headers.with_indifferent_access!
association_records = record.send(association_headers[:association]) association_records = record.send(association_headers[:association])
sheet_name = if association_headers[:sheet_name].present? sheet_name = if association_headers[:sheet_name].present?
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment