Skip to content

Integer filter accepts non-numeric strings. #83

@bobjflong

Description

@bobjflong

Eg. '123foo' gets converted to 123, due to the use of to_i. I think that it would be preferable for the integer filter to do something like:

begin
  data = Integer(data)
rescue ArgumentError
  return [data, :integer]
end

Let me know what you think, I can cut a PR if you want.

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