New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix problem with accessing deprecated constant proxy's subclass #36557
Fix problem with accessing deprecated constant proxy's subclass #36557
Conversation
dbd3260
to
7bac1e9
Compare
@matthewd I use Would you mind taking another look and merge it if you think it's good to go? |
7bac1e9
to
09b9d37
Compare
I removed the |
This commit fixes rails#36313. After rails#32065 moved `SourceAnnotationExtractor` into `Rails` module, it broke the ability to access `SourceAnnotationExtractor::Annotate` directly as user would get this error: TypeError: Rails::SourceAnnotationExtractor is not a class/module This commit fixes the issue by making `DeprecatedConstantProxy` to inherit from `Module` and then defines `method_missing` and `const_missing` to retain the previous functionality. Thank you Matthew Draper for the idea of how to fix the issue! [Prem Sichanugrist & Matthew Draper]
09b9d37
to
48c0abb
Compare
@matthewd actually, removing that cause this test to fail ( rails/activesupport/test/deprecation/proxy_wrappers_test.rb Lines 20 to 23 in a59b230
So, I've brought back that |
I'll merge because this has been waiting on me for ages (🙈), but I think that's a bad test (this class expects to receive strings containing the old/new constant names, not actual constant references) and can be deleted. |
…r-annotation Fix problem with accessing deprecated constant proxy's subclass
🎉thanks to you all! |
This commit fixes #36313.
After #32065 moved
SourceAnnotationExtractor
intoRails
module, it broke the ability to accessSourceAnnotationExtractor::Annotate
directly as user would get this error:This commit fixes the issue by making
DeprecatedConstantProxy
to inherit fromModule
and then definesmethod_missing
andconst_missing
to retain the previous functionality.Thank you @matthewd for the idea of how to fix the issue!