Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reset current scopes in AR using an on_unload callback
Rails 6.0 and Rails 6.1 didn't support the undocumented `before_remove_const` in `zeitwerk` mode. I noticed this cleanup in AR was not being executed, and restored the original code for Rails 7. However, invoking `respond_to?` in an `on_unload` callback may have unexpected side-effects, as seen in #44125. So, this patch reimplements the cleanup in a more modern way. Fixes #44125.
- Loading branch information
Showing
6 changed files
with
23 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ActiveRecord::Base > value
would avoid failure if some autoloaded class defines<