Upgrade Rails version from 5.1.4 to Rails 5.2.0

After the upgrade, I got the same error on each active record model using enum.

Error Message:- ArgumentError (You tried to define an enum named “enum_key” on the model “Modal”, but this will generate a class method “reject”, which is already defined by ActiveRecord::Relation.

Please suggest the solution

I assume one of the enum values is :reject? Then you could either rename it to something else or add _prefix or _suffix to the enum definition