diff options
author | Xavier Noria <fxn@hashref.com> | 2010-06-21 00:39:32 +0200 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2010-06-21 00:40:00 +0200 |
commit | b5fe014fdcc285f3bcb8779c4f7cfbc5a820856f (patch) | |
tree | b3beaa15b1d8d9f7d217978131cf5f86caf96a32 /railties/test/application | |
parent | 69fec3ab3fe1135ba949514b482c43ae659a3fa9 (diff) | |
download | rails-b5fe014fdcc285f3bcb8779c4f7cfbc5a820856f.tar.gz rails-b5fe014fdcc285f3bcb8779c4f7cfbc5a820856f.tar.bz2 rails-b5fe014fdcc285f3bcb8779c4f7cfbc5a820856f.zip |
files in the lib directory are no longer autoloaded
Conceptually, the lib directory is closer 3rd party libraries
than to the application itself. Thus, Rails adds it to Ruby's
load path ($LOAD_PATH, $:) but it is no longer included in
dependencies' load paths.
To enable autoloading back put this in your config/application.rb
config.load_paths += %W( #{config.root}/lib )
Diffstat (limited to 'railties/test/application')
-rw-r--r-- | railties/test/application/initializers/load_path_test.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/railties/test/application/initializers/load_path_test.rb b/railties/test/application/initializers/load_path_test.rb index 714d62311d..d9aac8719c 100644 --- a/railties/test/application/initializers/load_path_test.rb +++ b/railties/test/application/initializers/load_path_test.rb @@ -19,7 +19,7 @@ module ApplicationTests assert $:.include?("#{app_path}/app/models") end - test "initializing an application allows to load code on lib path inside application class definitation" do + test "initializing an application allows to load code on lib path inside application class definition" do app_file "lib/foo.rb", <<-RUBY module Foo; end RUBY @@ -60,6 +60,8 @@ module ApplicationTests add_to_config <<-RUBY config.root = "#{app_path}" + config.cache_classes = true + config.load_paths << "#{app_path}/lib" config.eager_load_paths << "#{app_path}/lib" RUBY |