On Tue, Oct 26, 2010 at 10:26 AM, Andrew White <[email protected]> wrote:

> It looks as though extra autoload_paths don't get added to eager_load_paths 
> by default and autoloading is turned off when cache_classes is true.

Indeed autoloading is on in any environment, that is, the
const_missing hook is always there.


f...@halmos:~/tmp/test-autoloading ∵ cat config/application.rb
require File.expand_path('../boot', __FILE__)
require 'rails/all'
module TestAutoloading
  class Application < Rails::Application
    config.autoload_paths += %W(#{config.root}/lib)
  end
end

f...@halmos:~/tmp/test-autoloading ∵ cat lib/foo.rb
module Foo
  p Rails.env
end

f...@halmos:~/tmp/test-autoloading ∵ rails runner -e production Foo
"production"

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-core?hl=en.

Reply via email to