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_getactually 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.