You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
386 B
16 lines
386 B
class Ecs::ImportCourseExcel < BaseImportExcel
|
|
def read_each(&block)
|
|
2.upto(sheet.last_row) do |row_num|
|
|
name = sheet.row(row_num)[0].to_s.strip
|
|
next if name.blank?
|
|
|
|
block.call(name)
|
|
end
|
|
end
|
|
|
|
private
|
|
|
|
def check_sheet_valid!
|
|
raise_import_error('请按照模板格式导入') if sheet.cell(1, 1) != '课程名称(必填)'
|
|
end
|
|
end |