How To Use Enums in Rails 6
An enum is a data type made out of a set of named values. Let’s leverage them
Published in
3 min readMar 18, 2021
In Ruby on Rails, an enum is an attribute where the values map to integers in the database and can be queried by name.
For example, we could define an enum for the status
attribute, where the possible values are pending
, active
, or archived
.