Commit 7715fbb7 by liyijie

feat: use dig instead of fetch

parent 98349322
......@@ -116,13 +116,13 @@ module TalltyImportExport
import_header_hash = import_headers.to_h { |header| [header.with_indifferent_access[:key], header] }.with_indifferent_access
@headers.map do |header|
key = header[:key]
if import_header_hash.fetch(key)&.fetch(:proc).present?
header[:proc] = import_header_hash.fetch(key)&.fetch(:proc)
if import_header_hash.dig(key, :proc).present?
header[:proc] = import_header_hash.dig(key, :proc)
end
header
end
# rescue
# @headers
rescue
@headers
end
def import_options
......
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