I would like to sort some of my models better into different folders.
Unfortunately when I do so it is unable to find the models.
I have updated the boot.rb file to:
#Rails::Initializer.run(:set_load_path)
Rails::Initializer.run do |config|
config.frameworks -= [ :action_web_service ]
config.load_paths += %W[
#{RAILS_ROOT}/app/models/
#{RAILS_ROOT}/app/models/associative/
]
end
Rails still does not seem to be able to find the models within the
“associative” folder.
pa = PersonAddress.new
NameError: uninitialized constant PersonAddress
from
/Library/Ruby/Gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:266:in
load_missing_constant' from /Library/Ruby/Gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:452:in
const_missing’
from
/Library/Ruby/Gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:464:in
`const_missing’
from (irb):3
Here is the contents of the file models/associative/person_address.rb:
class PersonAddress < ActiveRecord::Base
end
This post Simpler irb — err.the_blog is where I saw how to tweak the
root.rb file.
Thanks for the help