comma-csv/comma

Crash on class-level .to_comma_headers

aripollak opened this issue · 1 comments

In version 3.0.6, you could call Foo.to_comma_headers(:stylename). However, at some point between then and 3.2.2, it broke:

> Foo.to_comma_headers(:stylename)
NoMethodError: undefined method `[]' for nil:NilClass
    from /home/ari/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/comma-3.2.2/lib/comma/extractor.rb:15:in `results'
    from /home/ari/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/comma-3.2.2/lib/comma/object.rb:24:in `extract_with'
    from /home/ari/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/comma-3.2.2/lib/comma/object.rb:17:in `to_comma_headers'
    from (irb):3

You can still call to_comma_headers on an instance of Foo though.

Fixed and released version 3.2.3.

Thank you for reporting.