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.71k stars 142 forks source link

Engine inclusion #65

Closed sonnym closed 9 years ago

sonnym commented 10 years ago

This is an augmented version of #61. The method for getting all the engines changes between Rails 3 and 4, so this supports both. This feature is really awesome, so I would love to see it mainlined. Our particular use case is several applications sharing a core data model, and I want to be able to graph it from the Rails application, since the data model knows about nothing more than active_support, while railroady requires rails.

I have been a fan of Railroad for several years now - thanks for taking up the maintenance of it!

ghost commented 10 years ago

This doesn't handle namespaced engine models, they are ignored without the change I mentioned above and with the change they aren't found because extract_class_name ignores everything but the base name (see models_diagram.rb:44-46). This causes .constantize on models_diagram.rb:23 to fail, which results in the following warning:

Warning: exception uninitialized constant Model raised while trying to load model class

ghost commented 10 years ago

I submitted singlebrook/railroady#1 with these changes rather than create another PR here for them.

primableatom commented 10 years ago

@sonnym @BM5k good work on handling rails4 and namespaced models. I thought about that namespacing too!! but eventually went with the assumption that few of them REALLY namepsace models and just wanted people to to able to use it with simpler engines. But great to see things being taken forward. One more thing is try and specs to cover this boundary conditions. Keep up the good work!!!

preston commented 10 years ago

Could somebody test this against the v1.1.2 release that was just cut? I'd be happy to pull it in if everybody is happy with a patch against current HEAD.

preston commented 9 years ago

80 has been merged in, tagged and released as v1.3.0.