steveklabnik / request_store

Per-request global storage for Rack.
https://github.com/steveklabnik/request_store
MIT License
1.48k stars 87 forks source link

Rails console's #reload! now clears RequestStore #37

Closed MaxLap closed 9 years ago

MaxLap commented 9 years ago

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.

steveklabnik commented 9 years ago

Nice! Thank you!