diff options
Diffstat (limited to 'railties/lib/rails')
-rw-r--r-- | railties/lib/rails/tasks/zeitwerk.rake | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/railties/lib/rails/tasks/zeitwerk.rake b/railties/lib/rails/tasks/zeitwerk.rake index e748a479a7..57ee46c3c5 100644 --- a/railties/lib/rails/tasks/zeitwerk.rake +++ b/railties/lib/rails/tasks/zeitwerk.rake @@ -20,9 +20,6 @@ eager_load = ->() do end check_directory = ->(directory, parent, mismatches) do - # test/mailers/previews might not exist. - return unless File.exist?(directory) - Dir.foreach(directory) do |entry| next if entry.start_with?(".") next if parent == Object && entry == "concerns" @@ -94,7 +91,11 @@ namespace :zeitwerk do eager_load[] eager_load_paths = Rails.configuration.eager_load_namespaces.map do |eln| - eln.config.eager_load_paths if eln.respond_to?(:config) + if eln.respond_to?(:config) + eln.config.eager_load_paths.select do |elp| + Dir.exist?(elp) + end + end end.compact.flatten mismatches = [] |