Closed sonnym closed 9 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
I submitted singlebrook/railroady#1 with these changes rather than create another PR here for them.
@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!!!
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.
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
, whilerailroady
requires rails.I have been a fan of Railroad for several years now - thanks for taking up the maintenance of it!