-
Notifications
You must be signed in to change notification settings - Fork 21.8k
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
Don't leak Object constants in core_ext/module/qualified_const #17845
Conversation
That class was public. So we would have to deprecate all the code. |
Tried doing that and the whole test suite light up with deprecation warnings.
Maybe we can implement |
cc @fxn |
ACK! I am in an immersion working on the contrib app these days, gonna get back here soon. |
Module#const_defined? accepts constant paths in modern Ruby, we no longer need our qualified_* extensions. References #17845.
I have removed internal usage. I think we should just deprecate these extensions for later removal. |
@fxn I can try to issue a deprecation warning only once, so we don't flood logs with them. Should I do it in this PR? |
Hmmm.... in principle we could warn always, that's how we normally do it. @rafaelfranca WDYT? |
@gsamokovarov Are you still interested in working on this? I agree that we should always warn, not warn once. |
b524c7c
to
39c50b0
Compare
@sgrif Sure! Deprecated the |
39c50b0
to
bb29fbc
Compare
Don't leak Object constants in core_ext/module/qualified_const
Bumped on this one recently.
Actually, I think we can remove this altogether for Rails 5. Since Ruby 2,
Object.const_get
actually works for qualified constant names and doesn't raises an exception for absolute paths anymore.I grepped the code and its not used anywhere but its test.