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

issue when using rake diagram:all_with_engines #85

Open wugols2004 opened 9 years ago

wugols2004 commented 9 years ago

Currently tinkering railroady with spreecommerce and im getting a lot of uninitialized constant errors when generating the model using the all engines option. The model graph is blank but the controllers are generated with no problems.

dpritchett commented 9 years ago

+1, exact same issue here :)

preston commented 9 years ago

Anyone have a PR?

craigmcdonald commented 9 years ago

This would seem to be somewhat spree specific, in that the method:

def get_engine_files
    engines.collect { |engine| Dir.glob("#{engine.root.to_s}/app/models/**/*.rb")}.flatten
  end

Is not going to load the models correctly, since the spree gem is actually bunch of related gems, like spree-core, etc.

This means that the path for each models dir, is something like:

"#{engine.root.to_s}/**/app/models/**/*.rb"

I quickly threw this in to the railroady gem and it successfully generated a model diagram with less errors, although I'm posting this here more as a signpost than any sort of real solution at present.