I read a post about the rails load_paths, here is the link.
But, I am still confused about the difference between the autoload_paths
and eager_loa
Basically, autoload_paths
are paths Rails will use to try loading your classes automatically. E.g. when you call Book
, if that class isn't loaded yet, it will go through the autoload_paths
and look for it in those paths.
In production, it might be better to load those upfront to avoid autoload concurrent issues. For that, it provides the eager_load_paths
. Paths in that list will be required upfront when your application starts.