Skip to content

Remove EnumWithNil helper

Igor Drozdov requested to merge id-remove-enum-with-nil into master

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.

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

Merge request reports