In the Rails guides they have this code to load a path.
$LOAD_PATH << path
ActiveSupport::Dependencies.load_paths << path
ActiveSupport::Dependencies.load_once_paths.delete(path)
The first one I understand. That is for ruby to know where to require files.
But what does the second and the third one means?
Yes, the first line is for Ruby itself (and
$:too). The second one is very similar to the first one, but for ActiveSupport.So, if you need to reload your dependencies every new request, don’t add them to the one of
load_once_pathsdirectory.