Here is a hack of a fix I found:
http://d.hatena.ne.jp/zenpou/20081021/1224559643
There is certainly a more elegant way to do this, but it got the job
done when I needed to make some models right quick.
To summarize, from the link, in lib/railroad/app_diagram.rb
make the following change:
< File.basename(filename).chomp(".rb").camelize
---> prefix_classes = []
> controller_path = /app\/controllers\//
> model_path = /app\/models\//
>
> check_path = nil
> if filename =~ controller_path
> check_path = controller_path
> else filename =~ model_path
> check_path = model_path
> end
>
> if check_path
> prefix_class_names = filename.to_s.split(check_path).last
> File.dirname(prefix_class_names).each do | prefix_class_name |
> prefix_classes << prefix_class_name.camelize unless
prefix_class_name.blank? || prefix_class_name == "."
> end
> prefix_classes <<
File.basename(filename).chomp(".rb").camelize
> end
> prefix_classes.join("::")
Hope this is useful to someone
On Sep 16, 1:22 pm, "Kostas L."
<loup...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> Hi guys!
> I am having a problem using railroad gem while running the command:
> railroad -C | neato -Tpng > controllers.png
>
> i get this error:
> c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/
> dependenci
> es.rb:445:in `load_missing_constant'': uninitialized constant
> AdminSessionsContro
> ller (NameError)
> from c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/
> active_suppo
> rt/dependencies.rb:77:in `const_missing''
> from c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/
> active_suppo
> rt/dependencies.rb:89:in `const_missing''
> from c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/
> active_suppo
> rt/inflector.rb:352:in `constantize''
> from c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/
> active_suppo
> rt/inflector.rb:351:in `each''
> from c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/
> active_suppo
> rt/inflector.rb:351:in `constantize''
> from c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/
> active_suppo
> rt/core_ext/string/inflections.rb:162:in `constantize''
> from c:/ruby/lib/ruby/gems/1.8/gems/railroad-0.5.0/lib/
> railroad/controll
> ers_diagram.rb:28:in `generate''
> from c:/ruby/lib/ruby/gems/1.8/gems/railroad-0.5.0/lib/
> railroad/controll
> ers_diagram.rb:24:in `each''
> from c:/ruby/lib/ruby/gems/1.8/gems/railroad-0.5.0/lib/
> railroad/controll
> ers_diagram.rb:24:in `generate''
> from c:/ruby/lib/ruby/gems/1.8/gems/railroad-0.5.0/bin/
> railroad:47
> from c:/ruby/bin/railroad:19:in `load''
> from c:/ruby/bin/railroad:19
>
> Any suggestions how to solve this???
> Thanx in advance
> Kostas L.