Open
Description
Rails checks the mtime of files, so that Rails.application.reloaders.any?(&:updated?)
is false if none of the files in the autoload path have changed. This allows us to avoid running the code reloader unnecessarily.
However, if we have a file app/models/order.rb
, and we don't reference the Order
constant during application startup, then a change in the mtime of app/models/order.rb
needn't trigger the code reloader. However at the moment Rails just looks at the mtime of all files in the autoload path, regardless of whether those files were actually loaded.
Fixing this will result in fewer situations where we actually need to run the reloaders, which will improve the speed of running a command with spring.