rails/activesupport/lib
Kasper Timm Hansen 85211ea1ef Clear all current instances before a reload.
If users added an attribute or otherwise changed a CurrentAttributes subclass
they'd see exceptions on the next page load.

Because `ActiveSupport::CurrentAttributes.current_instances` would keep
references to the old instances from the previous request.

We can fix this by clearing out the `current_attributes` before we unload
constants. Then any change to the model can be autoloaded again since its
slot isn't taken by an old instance.

We'll still have to call reset before we clear so external collaborators,
like Time.zone, won't linger with their current value throughout other code.
2017-05-28 10:47:17 +02:00
..
active_support Clear all current instances before a reload. 2017-05-28 10:47:17 +02:00
active_support.rb ActiveSupport::CurrentAttributes provides a thread-isolated attributes singleton (#29180) 2017-05-26 20:00:27 +02:00