Some of my models are in folders to add some organization to what will eventually be hundreds of models. Somewhere I read that if you put config.load_paths += Dir[RAILS_ROOT + ''/app/models/*/''] in your environment.rb file, everything will get loaded correctly, but that is not the case. This actually causes many strange problems. For instance, occasionally I get errors because multiple instantiations of the same model have been created when I only expected one. I also get errors that seem to suggest that rails is misjudging the model''s name because of its inclusion in a folder. That is, rails will report that it could not find User::User when the user.rb model is in the user folder. Interestingly, my application works exactly as expected if, in addition to the above, I explicitly require each model file in application.rb: require "#{RAILS_ROOT}/app/models/image.rb" require "#{RAILS_ROOT}/app/models/group.rb" # ...etc. What is causing this? Is there a way to fix this besides my ugly application.rb hack? Thanks, -Daniel -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---