mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
load_application_classes requires files relative to the load path and without .rb extension, including .rb files in subdirectories
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user