method

new

Importance_0
v8.1.1 - Show latest stable - 0 notes - Class: Autoloaders
new() public

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File railties/lib/rails/autoloaders.rb, line 11
    def initialize
      # This `require` delays loading the library on purpose.
      #
      # In Rails 7.0.0, railties/lib/rails.rb loaded Zeitwerk as a side-effect,
      # but a couple of edge cases related to Bundler and Bootsnap showed up.
      # They had to do with order of decoration of `Kernel#require`, something
      # the three of them do.
      #
      # Delaying this `require` up to this point is a convenient trade-off.
      require "zeitwerk"

      @main = Zeitwerk::Loader.new
      @main.tag = "rails.main"
      @main.inflector = Inflector

      @once = Zeitwerk::Loader.new
      @once.tag = "rails.once"
      @once.inflector = Inflector
    end
Register or log in to add new notes.