Bugs: Browse | Submit New | Admin

[#15451] config.load_paths ignored

Date:
2007-11-08 11:52
Priority:
3
Submitted By:
Andre Sachs (asachs)
Assigned To:
Nobody (None)
Category:
None
State:
Open
Summary:
config.load_paths ignored

Detailed description
Rails Version: 1.2.3

I have a directory in app/models called report_query and it houses some modules and classes. At configuration time in
config/enironment.rb I specify the following :

    config.load_paths += %W(#{RAILS_ROOT}/app/models/report_query)

That allows the modules and classes to used as if they where in the app/models directory.

The error I get when i run railroad -M is :

System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/
dependencies.rb:249:in `load_missing_constant': Expected config/../app/models/report_query/achieved_uptime_query.rb
to define ReportQuery::AchievedUptimeQuery (LoadError)
	from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_s
upport/dependencies.rb:452:in `const_missing'
	from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_s
upport/inflector.rb:250:in `constantize'
	from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_s
upport/core_ext/string/inflections.rb:148:in `constantize'
	from /Library/Ruby/Gems/1.8/gems/railroad-0.4.0/lib/railroad/models_diagram.rb:25:in `generate'
	from /Library/Ruby/Gems/1.8/gems/railroad-0.4.0/lib/railroad/models_diagram.rb:24:in `each'
	from /Library/Ruby/Gems/1.8/gems/railroad-0.4.0/lib/railroad/models_diagram.rb:24:in `generate'
	from /Library/Ruby/Gems/1.8/gems/railroad-0.4.0/bin/railroad:40
	from /usr/bin/railroad:16:in `load'
	from /usr/bin/railroad:16

It looks like any subdirectory of app/model is then used in the name space for the subsequent require.

Any idea ?

Regards,
  Andre

Add A Comment: Notepad

Please login


Followup

Message
Date: 2008-12-05 16:52
Sender: Michael Hefferan

I am also having this problem. Rails Version 2.1.2

Regards,

Mike

Attached Files:

Name Description Download
No Files Currently Attached

Changes:

No Changes Have Been Made to This Item