Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed header row type mixup. #129

Closed
wants to merge 1 commit into from
Closed

Conversation

hannesl
Copy link

@hannesl hannesl commented May 7, 2014

When using sheet.parse() with a columns hash, I got the following error:

lib/roo/base.rb:588:in `set_headers': undefined method `map' for 1:Fixnum (NoMethodError)

Example code:

xls = Roo::Spreadsheet.open filepath
columns = {
  this: "This",
  that: "That"
}
rows = xls.sheet(0).parse columns <-- BOOM

Unless I'm using things incorrectly, this seems like a bug.

@Empact
Copy link
Contributor

Empact commented Nov 17, 2014

Hey @hannesl I suspect this is supposed to work a bit differently. If you read the #each documentation it says the values need to be found in the sheet. If they aren't, then the row_with method improperly returns the return value of #each - in this case 1. I just made a commit to fail informatively - how is that?

@stevendaniels
Copy link
Contributor

These changes were previously been merged into master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants