Commit ebcad94c by liyijie

fix: common model_headers use klass

parent d0a65122
......@@ -6,14 +6,14 @@ module TalltyImportExport
end
module ClassMethods
def model_headers **args
columns.map do |column|
def model_headers(**args)
klass.columns.map do |column|
{
key: column.name,
name: column.comment || column.name,
attr_type: column.type,
format: column.type == :string ? :string : nil,
primary_key: column.name == 'id' ? true : false
primary_key: column.name == 'id',
}
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