diff options
-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 |