Commit 3f32f36b by liyijie

feat: use Array.wrap

parent 5b2617e5
...@@ -70,9 +70,8 @@ module TalltyImportExport ...@@ -70,9 +70,8 @@ module TalltyImportExport
records.each do |record| records.each do |record|
context.record = record context.record = record
_export_association_headers = export_association_headers(**options) _export_association_headers = export_association_headers(**options)
_export_association_headers = _export_association_headers.is_a?(Array) ? _export_association_headers : [_export_association_headers] Array.wrap(_export_association_headers).each do |association_headers|
_export_association_headers.each do |association_headers| 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?
association_headers[:sheet_name].respond_to?(:call) ? association_headers[:sheet_name].respond_to?(:call) ?
......
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