Closed nrser closed 7 years ago
Hi Neil,
The Enum type uses the :in
symbol which it uses internally to check if all values are symbols, but it's also passed on to active_model (which NoBrainer uses internally), which is raising the "Size is not included in the list" error. I believe nilifying this value isn't possible right now.
I'm not sure if this is by design, but it's definitely not meant to accept any nil value right now.
You might want to create a :default
size and set that?
— Jeroen
Thanks for responding so rapidly. I understand it's not in your code. A default doesn't make sense for this situation, and just from searching and reading about ActiveRecord's Enum for a few minutes it seems like kind of a mess; I think I'll just use a different approach.
Just started out with NoBrainer, so forgive me if I am obviously missing something.
This doesn't seem to work:
Errors like
For what it's worth I also tried
which seems to make no difference, and
which pukes on the
nil
:Thanks in advance, Neil.