diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2008-07-31 16:35:17 -0700 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2008-07-31 16:35:17 -0700 |
commit | a540725f0d3439ea3b0f938d04ceed87d3690d9d (patch) | |
tree | 7ac86c7253c3523b0c19d631dbc9e230b3af75ca /railties/lib | |
parent | 2617d0dc5ced4b354bff9633bddafdf80ad5a711 (diff) | |
download | rails-a540725f0d3439ea3b0f938d04ceed87d3690d9d.tar.gz rails-a540725f0d3439ea3b0f938d04ceed87d3690d9d.tar.bz2 rails-a540725f0d3439ea3b0f938d04ceed87d3690d9d.zip |
load_application_classes requires files relative to the load path and without .rb extension, including .rb files in subdirectories
Diffstat (limited to 'railties/lib')
-rw-r--r-- | railties/lib/initializer.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/railties/lib/initializer.rb b/railties/lib/initializer.rb index 44c24e85f9..611e348acb 100644 --- a/railties/lib/initializer.rb +++ b/railties/lib/initializer.rb @@ -349,8 +349,9 @@ Run `rake gems:install` to install the missing gems. def load_application_classes if configuration.cache_classes configuration.eager_load_paths.each do |load_path| - Dir.glob("#{load_path}/*.rb").each do |file| - require_dependency file + matcher = /\A#{Regexp.escape(load_path)}(.*)\.rb\Z/ + Dir.glob("#{load_path}/**/*.rb").each do |file| + require_dependency file.sub(matcher, '\1') end end end |