My team recently found some utility from adding a small rake task that generates an active_record_enums lookup table with table, enum, value, and value_description as columns. We have a data team that runs reports against a follower db that were having to do this manually on their end.
After railsconf we were trying to think of ways we could start contributing to rails and wondered if this little script might be useful to others.
I suppose one thing this is missing is the ability to deal with removed values. I wonder if an ‘active’ or inverse ‘deprecated/decommissioned’ column would be useful. Then another pass could run through ActiveRecordEnum.all and compare to the enum_map to see if the enum still exists in the code.
The use case is for data reporting being run outside of our app that is ingesting tables via something like airbyte and gathering up raw enum values. For a while our data team kept their own maps of things like “status” column with value “0” means “draft” etc. This table and the rake task above gives them an easier way to get that label and avoids communication breakdowns when developers add a new option.