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.
17 lines
384 B
17 lines
384 B
class Admins::ImportDisciplineExcel < BaseImportXlsx
|
|
DisciplineData = Struct.new(:discipline_name, :sub_discipline_name)
|
|
|
|
def read_each(&block)
|
|
sheet.each_row_streaming(pad_cells: true, offset: 2) do |row|
|
|
data = row.map(&method(:cell_value))[1..2]
|
|
block.call DisciplineData.new(*data)
|
|
end
|
|
end
|
|
|
|
private
|
|
|
|
def cell_value(obj)
|
|
obj&.cell_value
|
|
end
|
|
end
|