aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/initializer.rb
diff options
context:
space:
mode:
Diffstat (limited to 'railties/lib/initializer.rb')
-rw-r--r--railties/lib/initializer.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/railties/lib/initializer.rb b/railties/lib/initializer.rb
index 88341b9d73..a2d08e2938 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