Commit 5507aa16 by liyijie

set options other params to @params

parent b1cb7abd
...@@ -54,6 +54,7 @@ module TalltyImportExport ...@@ -54,6 +54,7 @@ module TalltyImportExport
options = options.with_indifferent_access options = options.with_indifferent_access
@headers = options.delete(:headers) || import_headers @headers = options.delete(:headers) || import_headers
@primary_keys = options.delete(:primary_keys) || @headers.map { |header| header[:primary_key] ? header[:key].to_sym : nil }.compact @primary_keys = options.delete(:primary_keys) || @headers.map { |header| header[:primary_key] ? header[:key].to_sym : nil }.compact
@params = options
@excel_hash = @headers.reduce({}) do |h, header| @excel_hash = @headers.reduce({}) do |h, header|
h[header[:key].to_sym] = header[:name] h[header[:key].to_sym] = header[:name]
......
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