The default value depends on the config.load_defaults target version: Starting with version Setting this to false saves Ruby from checking these directories when resolving require calls with relative paths, and saves Bootsnap work and RAM, since it does not need to build an index for them. Zeitwerk uses absolute paths internally, and applications running in :zeitwerk mode do not need require_dependency, so models, controllers, jobs, etc. It is recommended to be set to false in :zeitwerk mode early, in config/application.rb. Says whether autoload paths have to be added to $LOAD_PATH. 3.2.1 config.add_autoload_paths_to_load_path The following configuration methods are to be called on a Rails::Railtie object, such as a subclass of Rails::Engine or Rails::Application. config.action_bug_exception_log_level: :error.3.1.1 Default Values for Target Version 7.1 In cases of conflicting values, newer versions take precedence over older versions. For example, config.load_defaults 6.1 will load defaults for all versions up to and including version 6.1.īelow are the default values associated with each target version. 3.1 Versioned Default ValuesĬonfig.load_defaults loads default configuration values for a target version and all versions prior. This will break because autoloading during initialization cannot be safely repeated when the app reloads. If you need to apply configuration directly to a class, use a lazy load hook in an initializer to avoid autoloading the class before initialization has completed.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |