{"action":"created","issue":{"url":"https://api.github.com/repos/rails/rails/issues/17845","labels_url":"https://api.github.com/repos/rails/rails/issues/17845/labels{/name}","comments_url":"https://api.github.com/repos/rails/rails/issues/17845/comments","events_url":"https://api.github.com/repos/rails/rails/issues/17845/events","html_url":"https://github.com/rails/rails/pull/17845","id":50423684,"number":17845,"title":"Don't leak Object constants in core_ext/module/qualified_const","user":{"login":"gsamokovarov","id":604618,"avatar_url":"https://avatars.githubusercontent.com/u/604618?v=3","gravatar_id":"","url":"https://api.github.com/users/gsamokovarov","html_url":"https://github.com/gsamokovarov","followers_url":"https://api.github.com/users/gsamokovarov/followers","following_url":"https://api.github.com/users/gsamokovarov/following{/other_user}","gists_url":"https://api.github.com/users/gsamokovarov/gists{/gist_id}","starred_url":"https://api.github.com/users/gsamokovarov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gsamokovarov/subscriptions","organizations_url":"https://api.github.com/users/gsamokovarov/orgs","repos_url":"https://api.github.com/users/gsamokovarov/repos","events_url":"https://api.github.com/users/gsamokovarov/events{/privacy}","received_events_url":"https://api.github.com/users/gsamokovarov/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/rails/rails/labels/activesupport","name":"activesupport","color":"FC9300"}],"state":"open","locked":false,"assignee":{"login":"sgrif","id":1529387,"avatar_url":"https://avatars.githubusercontent.com/u/1529387?v=3","gravatar_id":"","url":"https://api.github.com/users/sgrif","html_url":"https://github.com/sgrif","followers_url":"https://api.github.com/users/sgrif/followers","following_url":"https://api.github.com/users/sgrif/following{/other_user}","gists_url":"https://api.github.com/users/sgrif/gists{/gist_id}","starred_url":"https://api.github.com/users/sgrif/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sgrif/subscriptions","organizations_url":"https://api.github.com/users/sgrif/orgs","repos_url":"https://api.github.com/users/sgrif/repos","events_url":"https://api.github.com/users/sgrif/events{/privacy}","received_events_url":"https://api.github.com/users/sgrif/received_events","type":"User","site_admin":false},"milestone":null,"comments":8,"created_at":"2014-11-29T11:50:48Z","updated_at":"2015-11-23T21:35:09Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/rails/rails/pulls/17845","html_url":"https://github.com/rails/rails/pull/17845","diff_url":"https://github.com/rails/rails/pull/17845.diff","patch_url":"https://github.com/rails/rails/pull/17845.patch"},"body":"Bumped on this one recently.\r\n\r\nActually, I think we can remove this altogether for Rails 5. Since Ruby 2, [`Object.const_get`](http://ruby-doc.org/core-2.1.5/Module.html#method-i-const_get) actually works for qualified constant names and doesn't raises an exception for absolute paths anymore.\r\n\r\n```ruby\r\n>> Object.const_get '::String'\r\n=> String\r\n>> RUBY_VERSION\r\n=> \"2.1.4\"\r\n>> Object.const_get '::ActiveSupport::OrderedOptions'\r\n=> ActiveSupport::OrderedOptions\r\n```\r\n\r\nI grepped the code and its not used anywhere but its test.\r\n\r\n```bash\r\n♡  ag \"qualified_const_get\"\r\nactivesupport/lib/active_support/core_ext/module/qualified_const.rb\r\n26:# Object.const_get('::String') raises NameError and so does qualified_const_get.\r\n39:  def qualified_const_get(path)\r\n52:    mod = mod_name.empty? ? self : qualified_const_get(mod_name)\r\n\r\nactivesupport/test/core_ext/module/qualified_const_test.rb\r\n59:  test \"qualified_const_get\" do\r\n60:    assert_equal false, Object.qualified_const_get(\"QualifiedConstTestMod::X\")\r\n61:    assert_equal false, QualifiedConstTestMod.qualified_const_get(\"X\")\r\n62:    assert_equal 1, QualifiedConstTestMod.qualified_const_get(\"M::X\")\r\n63:    assert_equal 1, QualifiedConstTestMod.qualified_const_get(\"N::X\")\r\n64:    assert_equal 2, QualifiedConstTestMod.qualified_const_get(\"M::C::X\")\r\n66:    assert_raise(NameError) { QualifiedConstTestMod.qualified_const_get(\"M::C::Y\")}\r\n95:    assert_raise_with_message(NameError, \"wrong constant name ::X\") { Object.qualified_const_get(\"::X\")}\r\n96:    assert_raise_with_message(NameError, \"wrong constant name ::X\") { Object.qualified_const_get(\"::X::Y\")}\r\n\r\nguides/source/3_2_release_notes.md\r\n508:* Defined new methods `Module#qualified_const_defined?`, `Module#qualified_const_get` and `Module#qualified_const_set` that are analogous to the corresponding methods in the standard API, but accept qualified constant names.\r\n\r\nguides/source/active_support_core_extensions.md\r\n748:The new methods are `qualified_const_defined?`, `qualified_const_get`, and\r\n754:Object.qualified_const_get(\"Math::PI\")            # => 3.141592653589793\r\n761:Math.qualified_const_get(\"E\") # => 2.718281828459045\r\n1704:  mod = mod_name.empty? ? self : qualified_const_get(mod_name)\r\n```"},"comment":{"url":"https://api.github.com/repos/rails/rails/issues/comments/159072874","html_url":"https://github.com/rails/rails/pull/17845#issuecomment-159072874","issue_url":"https://api.github.com/repos/rails/rails/issues/17845","id":159072874,"user":{"login":"sgrif","id":1529387,"avatar_url":"https://avatars.githubusercontent.com/u/1529387?v=3","gravatar_id":"","url":"https://api.github.com/users/sgrif","html_url":"https://github.com/sgrif","followers_url":"https://api.github.com/users/sgrif/followers","following_url":"https://api.github.com/users/sgrif/following{/other_user}","gists_url":"https://api.github.com/users/sgrif/gists{/gist_id}","starred_url":"https://api.github.com/users/sgrif/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sgrif/subscriptions","organizations_url":"https://api.github.com/users/sgrif/orgs","repos_url":"https://api.github.com/users/sgrif/repos","events_url":"https://api.github.com/users/sgrif/events{/privacy}","received_events_url":"https://api.github.com/users/sgrif/received_events","type":"User","site_admin":false},"created_at":"2015-11-23T21:35:09Z","updated_at":"2015-11-23T21:35:09Z","body":"@gsamokovarov Are you still interested in working on this? I agree that we should always warn, not warn once."}}