aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/bootstrap.rb
diff options
context:
space:
mode:
authorJoshua Peek <josh@joshpeek.com>2010-01-18 15:37:18 -0600
committerJoshua Peek <josh@joshpeek.com>2010-01-18 15:37:58 -0600
commit59cd044310d4bb454d492addffb8bd60dd8a23a9 (patch)
tree10caddd62cef767ab919210339680a2f61a206a6 /railties/lib/rails/bootstrap.rb
parent9e7ec2a9f13aa52cdf07cf9308e8031548dcddc0 (diff)
downloadrails-59cd044310d4bb454d492addffb8bd60dd8a23a9.tar.gz
rails-59cd044310d4bb454d492addffb8bd60dd8a23a9.tar.bz2
rails-59cd044310d4bb454d492addffb8bd60dd8a23a9.zip
Add all folders in app/* to the load path
Diffstat (limited to 'railties/lib/rails/bootstrap.rb')
-rw-r--r--railties/lib/rails/bootstrap.rb11
1 files changed, 8 insertions, 3 deletions
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