No release in over a year
Generate UML class diagram for Mermaid.js from ActiveRecord instances by Rails runner.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme

ActiverecordUml

ActiverecordUml draws class diagrams of ActiveRecord models.

We sometimes wander in the existing Ruby on Rails application. All models are too much to see. We want to select from three to seven models to see their attributes and relations.

ActiverecordUml draws class diagrams of selected models to help to recognize their attributes and relations.

Installation

install it yourself as:

$ gem install activerecord_uml

Usage

In your Ruby on Rails directory:

activerecord_uml User Book Review

Execute the activerecord_uml command with name of model classes. Then the activerecord_uml outputs HTML text includes class diagrams of specified model classes.

For macOS, You can see the diagram:

activerecord_uml User Book Review > temp.html
open temp.html

I recommend to use the activerecord_uml with browser command. For example:

Install browser with Homebrew.

$ brew install browser

And then execute:

activerecord_uml User | browser

Open the class diagrams with the browser immediately.

activerecord_relations

If you want to see the complex relationships between classes, you can use the activecord_relations command.

activerecord_relations User Book Review

This command will only show the relationships between the specified classes.

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and the created tag, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/ledsun/activerecord_uml.