Skip to content

nomethod error when csv header is empty #1

@eadz

Description

@eadz

The function:
HeaderConverters = {
:downcase => lambda { |h| h.downcase },
:symbol => lambda { |h|
h.downcase.tr(" ", "").delete("^a-z0-9").to_sym
}
}

raises a nomethod exception when the header row is empty using :header_converter => :symbol

I am not sure of the correct solution but I am doing something like

h.downcase.tr(" ", "").delete("^a-z0-9").to_sym rescue :empty

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions