aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoryuuji.yaginuma <yuuji.yaginuma@gmail.com>2019-01-28 08:00:11 +0900
committeryuuji.yaginuma <yuuji.yaginuma@gmail.com>2019-01-28 08:00:11 +0900
commit1d26c86b8611bb37f5641d4f3e3e94d8675eba1d (patch)
tree085bb2211d4b22eea197ce13afc7fa1c9fa67d0f
parentaadeed1518b9092ea21adf49c728172368129f0e (diff)
downloadrails-1d26c86b8611bb37f5641d4f3e3e94d8675eba1d.tar.gz
rails-1d26c86b8611bb37f5641d4f3e3e94d8675eba1d.tar.bz2
rails-1d26c86b8611bb37f5641d4f3e3e94d8675eba1d.zip
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 aadeed1518b9092ea21adf49c728172368129f0e.
-rw-r--r--railties/lib/rails/engine.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/railties/lib/rails/engine.rb b/railties/lib/rails/engine.rb
index 6695507d93..d6c329b581 100644
--- a/railties/lib/rails/engine.rb
+++ b/railties/lib/rails/engine.rb
@@ -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