How can we automate generation of AASM diagrams, so our documentation will always be up to date with our code?
This gist does two main things that the aasm-diagram repo doesn't do on its own as of today (May 2025):
- Finds all of the uses of aasm in our Rails models itself, so we don't have to list them out
- Updates a markdown file that embeds each of the AASM diagrams
When should we generate this?
rails-erd uses database migrations as the moment to auto-generate an ERD diagram, which makes a ton of sense!