Commit e093080d by Ivan Lan

add autoload FormConvert

parent b97c253d
......@@ -12,6 +12,7 @@ module TalltyImportExport
autoload :Importable
autoload :Import
autoload :Context
autoload :FormConvert
class Error < StandardError; end
end
......@@ -14,7 +14,7 @@ module TalltyImportExport
# method: 导出时本地调用的方法
# chain: 导出时对象属性通过链式调用
def export_xlsx records, options={}
def export_records records, options={}
exportable_defaults(options)
options = options.with_indifferent_access
......@@ -67,7 +67,6 @@ module TalltyImportExport
end
def export_headers
binding.pry
klass.try(:headers) || klass.try(:model_headers)
end
......
module TalltyImportExport
class FormConvert
class << self
def import_headers form, column_name: :payload
def headers form, column_name: :payload
form.fields.map do |field|
{}.tap do |q|
q[:key] = field.key
......
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