Sometimes you have members from your data team who are looking at the database and have no idea what the enum integer values mean. This snippet of code helps to extract the readable names for those integers into markdown tables to help out your data team.
There are alternative approaches by using string enums via gems, or database enums, but this was made for an environment where those weren't an option (legacy enums, and no database enums available).
You could also put this into a Rake task and publish it into a wiki.
enum_mappings = extract_enum_mappings_from_all_models markdown = enum_mappings_to_markdown(enum_mappings) puts markdown
Check the sample below to see how the markdown looks like.