• Jan Provaznik's avatar
    Enable mapping to nil in enums · 0665a8f7
    Jan Provaznik authored
    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.
    0665a8f7
pipeline.rb 17.5 KB