Project

draw_me

0.0
No commit activity in last 3 years
No release in over 3 years
By utilizing matsuda stateful enum gem.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 1.14
~> 10.0
 Project Readme

DrawMe

This gem is used to generate state diagram for AASM gem. This gem utilize Matsuda's stateful_enum gem graph generator to generate AASM state diagram. Tested with rails 5.1.4

Installation

Before we start with DrawMe gem there are dependencies for AASM gem such as graphiz installation and other stuff are need to be done beforehand. Please head to AASM gem page for more info about the setup.

  1. Create a doc folder in your app root directory.

  2. Add this line to your application's Gemfile:

gem 'aasm'
gem 'stateful_enum'
gem 'draw_me'
  1. And then execute:

    $ bundle

Usage

  1. include it into your model or directly into your ApplicationRecord file.
class EmergencyPurchase < ApplicationRecord
  include AASM
  include DrawMe
end
  1. Use it in your console
$ rails c
2.4.0 :001 > to_draw = EmergencyPurchase.last
2.4.0 :001 > to_draw.draw_me
emergencypurchase_graph
=> 1

if you want to draw all diagram for all of your models :

2.4.0 :001 > ApplicationRecord.draw_all

You should be able to find your graph in the doc folder in your root directory.

Screenshot

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/abigoroth/draw_me. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The gem is available as open source under the terms of the MIT License.