method

setup_autoloaders

rails latest stable - Class: ActiveSupport::Dependencies::ZeitwerkIntegration

Method deprecated or moved

This method is deprecated or moved on the latest stable version. The last existing version (v6.1.7.7) is shown here.

setup_autoloaders(enable_reloading)
private

No documentation available.

# File activesupport/lib/active_support/dependencies/zeitwerk_integration.rb, line 78
          def setup_autoloaders(enable_reloading)
            Dependencies.autoload_paths.each do |autoload_path|
              # Zeitwerk only accepts existing directories in `push_dir` to
              # prevent misconfigurations.
              next unless File.directory?(autoload_path)

              autoloader =                  autoload_once?(autoload_path) ? Rails.autoloaders.once : Rails.autoloaders.main

              autoloader.push_dir(autoload_path)
              autoloader.do_not_eager_load(autoload_path) unless eager_load?(autoload_path)
            end

            Rails.autoloaders.main.enable_reloading if enable_reloading

            # Order matters.
            Rails.autoloaders.once.setup
            Rails.autoloaders.main.setup
          end