railroady icon indicating copy to clipboard operation
railroady copied to clipboard

issue when using rake diagram:all_with_engines

Open wugols2004 opened this issue 10 years ago • 3 comments

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.

wugols2004 avatar Jan 12 '15 20:01 wugols2004

+1, exact same issue here :)

dpritchett avatar Apr 09 '15 18:04 dpritchett

Anyone have a PR?

preston avatar Apr 10 '15 17:04 preston

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.

craigmcdonald avatar Jun 04 '15 23:06 craigmcdonald