preston / railroady

Ruby on Rails 3/4/5 model and controller UML class diagram generator. (`brew/port/apt-get install graphviz` before use!)
Other
1.72k stars 142 forks source link

Patch aasm_diagram to support Rails 4 and AASM 4 #111

Closed zetavg closed 7 years ago

zetavg commented 8 years ago

This works for me to generate the AASM diagram on my Rails 4.2.6 and AASM 4.10.1 project.

preston commented 8 years ago

Can anyone that uses AASM commit on this? I don't use this feature so it's hard for me to comment on what, if any, the implications are. :-/ I'm happy to merge if it isn't doesn't break support.

Has AASM support been broken and just went unreported?

preston commented 8 years ago

@Neson Is AASM support broken in the current release version?

davidferril commented 8 years ago

@preston yes it seems to be. running railroady -A -s app/models/<some_model>.rb yields

.../gems/railroady-1.5.1/lib/railroady/aasm_diagram.rb:66:in block in process_acts_as_state_machine_class': undefined method 'initial_state' for :Class (NoMethodError)

when using it with Rails 4.2.5 and AASM 4.2.0

this patch seems to fix exactly that

preston commented 8 years ago

A'ight .. I'll make a note to merge this in to the next maintenance release. Holiday weekend here but I'll try to get to it soon!

preston commented 7 years ago

Merged in via cherry pick in commit 78d2a5ab4b989e95088760f8ef5d9058133c0ab3.

preston commented 7 years ago

@davidferril @Neson Released in v1.5.2!