[rspec-users] warning: toplevel constant XYZ referenced Admin:XYZ

Tom D. lists at ruby-forum.com
Wed May 15 14:40:50 UTC 2013


the following is lifted from the 'Gotchas' section of my own internal 
wiki, i hope it help's someone else some day.


Can't load namespaced controllers

Errors:

warning: toplevel constant Finance referenced by Member::Finance

OR

uninitialized constant Finance

Cause:

a namespaced controller / helper which is listed BEFORE it's dependency. 
e.g. ll member/finance/ bank_batches_controller.rb base_controller.rb

Fix:

make this the first line of the dependent require_dependency 
"#{RAILS_ROOT}/app/controllers/member/finance/base_controller". 
requiring the dependent file before attempting to load the class. Yes, 
this goes before class ...

-- 
Posted via http://www.ruby-forum.com/.


More information about the rspec-users mailing list