diff options
author | Xavier Noria <fxn@hashref.com> | 2010-06-28 00:12:15 +0200 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2010-06-28 00:12:15 +0200 |
commit | 4329f8133fee8e4f3e558787f67de59f0c4a4dd1 (patch) | |
tree | 346ef7340d8348e50d119ca749a16c1654c20a08 /railties/lib/rails/engine.rb | |
parent | c37f7d66e49ffe5ac2115cc30e5529fd1c2924a8 (diff) | |
parent | ebee77a28a7267d5f23a28ba23c1eb88a2d7d527 (diff) | |
download | rails-4329f8133fee8e4f3e558787f67de59f0c4a4dd1.tar.gz rails-4329f8133fee8e4f3e558787f67de59f0c4a4dd1.tar.bz2 rails-4329f8133fee8e4f3e558787f67de59f0c4a4dd1.zip |
Merge remote branch 'rails/master'
Diffstat (limited to 'railties/lib/rails/engine.rb')
-rw-r--r-- | railties/lib/rails/engine.rb | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/railties/lib/rails/engine.rb b/railties/lib/rails/engine.rb index cdb00a4eff..0a3f21fb1b 100644 --- a/railties/lib/rails/engine.rb +++ b/railties/lib/rails/engine.rb @@ -32,14 +32,14 @@ module Rails # == Configuration # # Besides the Railtie configuration which is shared across the application, in a - # Rails::Engine you can access load_paths, eager_load_paths and load_once_paths, + # Rails::Engine you can access autoload_paths, eager_load_paths and autoload_once_paths, # which differently from a Railtie, are scoped to the current Engine. # # Example: # # class MyEngine < Rails::Engine # # Add a load path for this specific Engine - # config.load_paths << File.expand_path("../lib/some/path", __FILE__) + # config.autoload_paths << File.expand_path("../lib/some/path", __FILE__) # # initializer "my_engine.add_middleware" do |app| # app.middleware.use MyEngine::Middleware @@ -142,7 +142,7 @@ module Rails # Add configured load paths to ruby load paths and remove duplicates. initializer :set_load_path, :before => :bootstrap_hook do - config.load_paths.reverse_each do |path| + config.autoload_paths.reverse_each do |path| $LOAD_PATH.unshift(path) if File.directory?(path) end $LOAD_PATH.uniq! @@ -154,17 +154,17 @@ module Rails # This needs to be an initializer, since it needs to run once # per engine and get the engine as a block parameter initializer :set_autoload_paths, :before => :bootstrap_hook do |app| - ActiveSupport::Dependencies.load_paths.unshift(*config.load_paths) + ActiveSupport::Dependencies.autoload_paths.unshift(*config.autoload_paths) if reloadable?(app) - ActiveSupport::Dependencies.load_once_paths.unshift(*config.load_once_paths) + ActiveSupport::Dependencies.autoload_once_paths.unshift(*config.autoload_once_paths) else - ActiveSupport::Dependencies.load_once_paths.unshift(*config.load_paths) + ActiveSupport::Dependencies.autoload_once_paths.unshift(*config.autoload_paths) end # Freeze so future modifications will fail rather than do nothing mysteriously - config.load_paths.freeze - config.load_once_paths.freeze + config.autoload_paths.freeze + config.autoload_once_paths.freeze end initializer :add_routing_paths do |app| |