Reputation: 520
I'm developing a Rails app using the rails s
WEBrick server. For some reason, even though I'm in development mode, one of my controller classes looks like it's still being cached since the controller's class variable values are persisting between page requests.
Is this an expected behavior, considering that in my config/environments/development.rb file, I have the following settings?
config.cache_classes = false
config.action_controller.perform_caching = false
Thanks!
UPDATE: Really, I'm mostly looking to understand why the controller's class variables continue to store their values between page requests when I'd expect those values to be cleared every time I navigate to a new page.
Upvotes: 1
Views: 1227
Reputation: 9722
By default, Rails reloads classes only if they change. This can be changed by setting
config.reload_classes_only_on_change = false
This should reload the classes on every request and reinitialize the class variables.
Upvotes: 3