As a Rails developer, I used to directly map my business models into code within AR instances but as the number of models grows, it become difficult to have a clear idea of the whole picture.
I discovered rails-erd gem and started to use it intensively to have a snapshot of the models relations and associations inside the app by generating an ERD from your models.
rails-erd automatically generates a PDF with your app models graph using graphviz library.
Here's how to use it
Install graphviz (if not yet)
sudo apt-get install graphviz
Add the gem
In the project gemfile add
group :development do gem 'rails-erd' end
cd PATH_OF_THE_PROJECT && bundle install
It's as simple as a
bundle exec rake erd and it will generate a PDF file in the root of the app.
See what it can do here in the erd gallery