{"action":"created","issue":{"url":"https://api.github.com/repos/rails/rails/issues/18531","labels_url":"https://api.github.com/repos/rails/rails/issues/18531/labels{/name}","comments_url":"https://api.github.com/repos/rails/rails/issues/18531/comments","events_url":"https://api.github.com/repos/rails/rails/issues/18531/events","html_url":"https://github.com/rails/rails/issues/18531","id":54447226,"number":18531,"title":"Can we get a method \"HashWithIndifferentAccess#symbolize_keys!\"","user":{"login":"georgemillo","id":2656485,"avatar_url":"https://avatars.githubusercontent.com/u/2656485?v=3","gravatar_id":"","url":"https://api.github.com/users/georgemillo","html_url":"https://github.com/georgemillo","followers_url":"https://api.github.com/users/georgemillo/followers","following_url":"https://api.github.com/users/georgemillo/following{/other_user}","gists_url":"https://api.github.com/users/georgemillo/gists{/gist_id}","starred_url":"https://api.github.com/users/georgemillo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/georgemillo/subscriptions","organizations_url":"https://api.github.com/users/georgemillo/orgs","repos_url":"https://api.github.com/users/georgemillo/repos","events_url":"https://api.github.com/users/georgemillo/events{/privacy}","received_events_url":"https://api.github.com/users/georgemillo/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-01-15T13:09:18Z","updated_at":"2015-01-25T04:24:45Z","closed_at":"2015-01-25T04:24:45Z","body":"When I'm writing a method which takes an options hash, I often use `symbolize_keys!` on the hash to avoid any issues with users passing in string keys:\r\n\r\n    def my_awesome_method(opts={})\r\n      opts.symbolize_keys!\r\n      # Perform magic...\r\n    end\r\n\r\nThe problem is, if somebody passes in a `HashWithIndifferentAccess` to this method, it will fail with a `NoMethodError`: `undefined method `symbolize_keys!'`.\r\n\r\nI could always work around this by avoiding the bang-method:\r\n\r\n    def my_awesome_method(opts={})\r\n      opts = opts .symbolize_keys\r\n      # Perform magic...\r\n    end\r\n\r\nBut I don't understand why this method should be removed in the first place.\r\n\r\nLooks like this was added by [2472f1026](https://github.com/rails/rails/commit/2472f1026a7d3b3309937568204a5b46b60c2c3c) back in 2010. \r\n\r\nJust wondering what the reasoning behind this is? Wouldn't it make more sense to define `symbolize_keys!` as a no-op an make HashWithIndifferentAccess quack completely like a Hash?"},"comment":{"url":"https://api.github.com/repos/rails/rails/issues/comments/71351345","html_url":"https://github.com/rails/rails/issues/18531#issuecomment-71351345","issue_url":"https://api.github.com/repos/rails/rails/issues/18531","id":71351345,"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-01-25T04:24:45Z","updated_at":"2015-01-25T04:24:45Z","body":"Seems like there's a consensus that this method doesn't make sense for HWIDA. I'm going to close this to clear out the issues tracker. If you think there's additional discussion to be had, please let me know and I will re-open."}}