Commit 9e3a100d by liyijie

records each_method should be each or find_each

parent a72453a7
...@@ -37,7 +37,8 @@ module TalltyImportExport ...@@ -37,7 +37,8 @@ module TalltyImportExport
sheet.add_row @headers.map{|header| header[:name]}, style: title2, height: 39 sheet.add_row @headers.map{|header| header[:name]}, style: title2, height: 39
records.find_each do |record| each_method = records.is_a?(Array) ? :each : :find_each
records.send(each_method) do |record|
row = [] row = []
headers.each{ |header| row.push(handle_data(record, header)) } headers.each{ |header| row.push(handle_data(record, header)) }
sheet.add_row row, style: title3, height: @row_height, types: @headers.map{|header| header[:format]} sheet.add_row row, style: title3, height: @row_height, types: @headers.map{|header| header[:format]}
......
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