1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Convert path to string before call length

Because eager load paths support to using `Pathname`, and `Pathname`
doesn't have `length` method.
Ref: https://travis-ci.org/rails/rails/jobs/485088071#L5140-L5143

Follow up aadeed1518.
This commit is contained in:
yuuji.yaginuma 2019-01-28 08:00:11 +09:00
parent aadeed1518
commit 1d26c86b86

View file

@ -474,7 +474,7 @@ module Rails
def eager_load! def eager_load!
config.eager_load_paths.each do |load_path| config.eager_load_paths.each do |load_path|
# Starts after load_path plus a slash, ends before ".rb". # Starts after load_path plus a slash, ends before ".rb".
relname_range = (load_path.length + 1)...-3 relname_range = (load_path.to_s.length + 1)...-3
Dir.glob("#{load_path}/**/*.rb").sort.each do |file| Dir.glob("#{load_path}/**/*.rb").sort.each do |file|
require_dependency file[relname_range] require_dependency file[relname_range]
end end