Entity-Relationship Diagrams for Ruby on Rails Rails ERD

Entity-Relationship Diagram for Rails

Document your Rails 3 application with automatically generated model diagrams.

Customise the diagram style, or create your own diagrams.

Include meta-programmed associations.

Rails ERD is a plugin for Ruby on Rails that generates diagrams based on your Active Record models. Such an entity-relationship diagram gives an overview of your models and how they are associated. Browse through example diagrams, or read the installation instructions.

How does it work?

Rails ERD loads your Active Record models and processes all their attributes and associations (has_one, has_many, etc.). This information is combined into a single diagram. Because Rails ERD uses reflection instead of static analysis, it even recognises meta-programmed associations.

The standard output may provide everything you are looking for. And if the customisation options are not sufficient, you can still use Rails ERD. It has a flexible API that allows you to inspect your models.

Why use Rails ERD?

Understanding an application starts with understanding its domain model. Model diagrams have been used to visualise data structures since the 1960s. They started out as simple depictions of relationships between entities, but all kinds of features and notations have been added since. Some esoteric symbols make entity-relationship diagrams more daunting than they should be.

Rails ERD was created to bring back simplicity to model diagrams. It takes a single command to generate a diagram. And in the default notation, the only symbol that is used is an arrow.

Another goal of Rails ERD is to be so extensible that it's the last diagramming tool for Active Record models that you'll ever need. If the standard output is unsatisfying, it shouldn't be a reason to have to switch to a different tool. But if you think Rails ERD can be improved in any way, your feedback and contributions are much appreciated!