Remove EnumWithNil helper
What does this MR do and why?
Commit that introduced the change: 0665a8f7
Enums are working correctly with nil values in Rails 6.1, we can remove the helper.
- Rails 5: https://github.com/rails/rails/blob/v5.2.8.1/activerecord/lib/active_record/enum.rb#L151
- Rails 6.1: https://github.com/rails/rails/blob/f0c5e60aed8bdce96c385cad05b1e34d7d757038/activerecord/lib/active_record/enum.rb#L232
public_send(:"#{name}_for_database") == value
is used instead and "#{name}_for_database"
returns nil
when the database value is nil
.
Even more context, Rails 7 changed the method signature of enum
method: !90907 (e621267c)
Edited by Igor Drozdov