in your Gemfile
gem "stringified_enum"
in you ActiveRecord model
class Item < ApplicationRecord
include StringifiedEnum
stringified_enum status: %i(active inactive)
end
It works as a shortcut for the original ActiveRecord::Enum definition. For example the code above is equivalent to:
class Item < ApplicationRecord
enum status: { active: "active", inactive: "inactive" }
end