From 59cd044310d4bb454d492addffb8bd60dd8a23a9 Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Mon, 18 Jan 2010 15:37:18 -0600 Subject: Add all folders in app/* to the load path --- railties/lib/rails/bootstrap.rb | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'railties/lib/rails/bootstrap.rb') diff --git a/railties/lib/rails/bootstrap.rb b/railties/lib/rails/bootstrap.rb index b7cf70747a..5db663f9ef 100644 --- a/railties/lib/rails/bootstrap.rb +++ b/railties/lib/rails/bootstrap.rb @@ -23,8 +23,8 @@ module Rails # the load_once paths. initializer :set_autoload_paths do require 'active_support/dependencies' - ActiveSupport::Dependencies.load_paths = config.load_paths.uniq - ActiveSupport::Dependencies.load_once_paths = config.load_once_paths.uniq + ActiveSupport::Dependencies.load_paths = expand_load_path(config.load_paths) + ActiveSupport::Dependencies.load_once_paths = expand_load_path(config.load_once_paths) extra = ActiveSupport::Dependencies.load_once_paths - ActiveSupport::Dependencies.load_paths unless extra.empty? @@ -140,7 +140,7 @@ module Rails end end - initializer :initialize_notifications do + initializer :initialize_notifications do require 'active_support/notifications' if config.colorize_logging == false @@ -152,5 +152,10 @@ module Rails Rails::Subscriber.dispatch(args) end end + + private + def expand_load_path(load_paths) + load_paths.map { |path| Dir.glob(path.to_s) }.flatten.uniq + end end end -- cgit v1.2.3