Open Kutomore opened 4 years ago
sheet.each(headers: :first_row)
is what you want, but sadly yields the header row at the moment, so you'll have to skip that.
sheet.parse(headers: :first_row).each
works correctly, but will cost you a bit more memory.
Issue
I have a multisheet xlsx file in which the pagename is a class name, and every row name matches an attribute on my database.
I want to do something like
Which would require me to have the row as a hash instead of an array.
The documentation suggests:
But having to specify the attributes for each model would make the code very repetitive and ugly, is there a way for me to let the gem know that, for example the id column will match the id attribute?