Rails 5 Disables Autoloading in Production
Before Rails 5, all constants were loaded via ‘autoloading’ when the application booted up. Rails 5 replaced this with ‘eager loading,’ i.e loading all the constants even before they are actually needed.
With ‘autoloading,’ the application does not load the constant until it is needed. Once a class is needed, if it is missing then the application starts looking in ‘autoload paths’ to load it. Eager_load_paths
contains a list of directories. When the application boots then it loads all constants found in all directories listed in eager_load_paths.