Open javierseixas opened 4 years ago
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.
nil
0
0.0
''
allow_nil
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:
Integer
case value when nil then options[:allow_nil] ? nil : value ...
hey, sorry for the long delay. Thanks for the report!
I think it will be a good idea to fix it. Do you want to prepare PR?
Hi!
With #27 and its release in v0.9.5 a bug was introduced:
nil
values are converted to0
,0.0
or''
ifallow_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: