By registering to ActionDispatch::Reloader, we make the #reload! method in a rails console clear the RequestStore, solving possible issues where instances of old classes remain, and also just logically make a #reload! more complete.
The callback is also called after every requests in development (when config.cache_classes is false), but considering how light RequestStore::clear! is, and that this is only in dev, that's a non-issue.
By registering to ActionDispatch::Reloader, we make the #reload! method in a rails console clear the RequestStore, solving possible issues where instances of old classes remain, and also just logically make a #reload! more complete.
The callback is also called after every requests in development (when config.cache_classes is false), but considering how light RequestStore::clear! is, and that this is only in dev, that's a non-issue.