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
1 changed files with 1 additions and 1 deletions

View File

@ -474,7 +474,7 @@ module Rails
def eager_load!
config.eager_load_paths.each do |load_path|
# 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|
require_dependency file[relname_range]
end