Skip to content

allow_nil option transforms nil values when should not #35

@javierseixas

Description

@javierseixas

Hi!

With #27 and its release in v0.9.5 a bug was introduced: nil values are converted to 0, 0.0 or '' if allow_nil is not allowed.

I think that the behavior should be that a nil should be allowed if option is enabled, but if not, the value should remain.

So, in the Integer case, I would suggest:

case value
when nil then options[:allow_nil] ? nil : value
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions