mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
If a file is in the load path, require it without its full path (in more places)
This commit is contained in:
@@ -388,8 +388,13 @@ module ActiveSupport #:nodoc:
|
||||
end
|
||||
|
||||
# Search for a file in autoload_paths matching the provided suffix.
|
||||
def search_for_file(path_suffix)
|
||||
path_suffix = path_suffix.sub(/(\.rb)?$/, ".rb")
|
||||
def search_for_file(file)
|
||||
path_suffix = file.sub(/(\.rb)?$/, ".rb")
|
||||
|
||||
$:.each do |root|
|
||||
path = File.join(root, path_suffix)
|
||||
return file if File.file?(path)
|
||||
end
|
||||
|
||||
autoload_paths.each do |root|
|
||||
path = File.join(root, path_suffix)
|
||||
|
||||
Reference in New Issue
Block a user