Commit 840c8fbb by liyijie

fix: 传入export_headers,使用symbolize_keys

parent fd5b27d2
...@@ -162,14 +162,14 @@ module TalltyImportExport ...@@ -162,14 +162,14 @@ module TalltyImportExport
def export_headers_result **options def export_headers_result **options
if @headers.present? && @group_key.blank? if @headers.present? && @group_key.blank?
headers_hash = @headers.to_h { |header| [header.with_indifferent_access[:key], header] }.with_indifferent_access headers_hash = @headers.to_h { |header| [header.with_indifferent_access[:key], header] }.with_indifferent_access
export_headers(**options).select do |_header| export_headers(**options.symbolize_keys).select do |_header|
_header.with_indifferent_access[:key].to_s.in?(headers_hash.keys) _header.with_indifferent_access[:key].to_s.in?(headers_hash.keys)
end.map do |_header| end.map do |_header|
_header = _header.with_indifferent_access _header = _header.with_indifferent_access
_header.merge(headers_hash[_header[:key]].delete_if { |k, v| v.blank? }) _header.merge(headers_hash[_header[:key]].delete_if { |k, v| v.blank? })
end end
else else
@headers = export_headers(**options) @headers = export_headers(**options.symbolize_keys)
end end
end end
......
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