Closed caioeps closed 6 years ago
hey, I think raising error for arr: nil
is expected behaviour. What do you want to see here?
I was expecting to build an object with an empty array instead. Something like this:
user = User.new arr: nil
#=> #<User arr=[]>
okay, but nil
is not Array
type. In this case you need to use Null | Array
type 🤔
I think he's expecting input.to_a
at coercing (nil.to_a #=> []
).
Oh, I see. In this case I'll have to implement my own Array type. I was actually wondering if it wasn't supposed to use the default value if passing nil
as argument. Thanks for taking your time to answer me! Great gem, though :)
Hi! I'm facing an issue when assigning a
nil
value to an Array type attribute.Context:
However, when not passing
arr
it works as expected.Is this the expected behaviour? I can create a PR if you want to, I'm needing this :)