-
- Downloads
Enable mapping to nil in enums
Enum in Rails 5 does not map nil values - IOW nil value remains nil, even if there is a key with nil value in the enum definition. This commit overrides the underlying Enum methods so nil value is still mapped. This solution is far from being ideal: it uses dynamic definition of methods which introduces more magic/confusion into the codebase. It would be better to get rid of the nil value in enums.
parent
41eab9a9
No related branches found
No related tags found
app/models/concerns/enum_with_nil.rb
0 → 100644
Please register or sign in to comment