{"action":"created","issue":{"url":"https://api.github.com/repos/rails/rails/issues/23599","repository_url":"https://api.github.com/repos/rails/rails","labels_url":"https://api.github.com/repos/rails/rails/issues/23599/labels{/name}","comments_url":"https://api.github.com/repos/rails/rails/issues/23599/comments","events_url":"https://api.github.com/repos/rails/rails/issues/23599/events","html_url":"https://github.com/rails/rails/issues/23599","id":132830352,"number":23599,"title":"AC::Parameters `transform_keys` does not work as a substitute for deprecated `symbolize_keys`","user":{"login":"why-el","id":1326771,"avatar_url":"https://avatars.githubusercontent.com/u/1326771?v=3","gravatar_id":"","url":"https://api.github.com/users/why-el","html_url":"https://github.com/why-el","followers_url":"https://api.github.com/users/why-el/followers","following_url":"https://api.github.com/users/why-el/following{/other_user}","gists_url":"https://api.github.com/users/why-el/gists{/gist_id}","starred_url":"https://api.github.com/users/why-el/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/why-el/subscriptions","organizations_url":"https://api.github.com/users/why-el/orgs","repos_url":"https://api.github.com/users/why-el/repos","events_url":"https://api.github.com/users/why-el/events{/privacy}","received_events_url":"https://api.github.com/users/why-el/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/rails/rails/labels/actionpack","name":"actionpack","color":"FFF700"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-02-10T22:06:43Z","updated_at":"2016-02-10T22:41:19Z","closed_at":"2016-02-10T22:27:50Z","body":"Hey,\r\n\r\nI am in the middle of an update to Rails 5. In my app I am passing params to a path helper and I needed to call `symbolize_keys` (since now they keys must be symbols, per https://github.com/rails/rails/issues/20353). Since `symbolize_keys` is deprecated, I figured `transform_keys` would be perfect substitute, but this does not work for `AC::Parameters` because it is still relaying on a `HashWithIndifferentAccess` instance under the hood. \r\n\r\nIs any of this intended behavior? I understand it might be tricky, since moving away from `HashWithIndifferentAccess` would be a far bigger change than simply moving away from `Hash` like `AC::Parameters` already did. However, and since the initial reasoning for the move away was security issues, wouldn't the same apply to `HashWithIndifferentAccess`? Or are we operating under the assumption that the underlying `HashWithIndifferentAccess` should be private state of `params`? \r\n\r\nReproduction script:\r\n\r\n```\r\nbegin\r\n  require 'bundler/inline'\r\nrescue LoadError => e\r\n  $stderr.puts 'Bundler version 1.10 or later is required. Please update your Bundler'\r\n  raise e\r\nend\r\n\r\ngemfile(true) do\r\n  source 'https://rubygems.org'\r\n  gem 'rails', github: 'rails/rails'\r\n  gem 'arel', github: 'rails/arel'\r\n  gem 'rack', github: 'rack/rack'\r\n  gem 'sprockets', github: 'rails/sprockets'\r\n  gem 'sprockets-rails', github: 'rails/sprockets-rails'\r\n  gem 'sass-rails', github: 'rails/sass-rails'\r\nend\r\n\r\nrequire 'action_controller/railtie'\r\n\r\nclass TestApp < Rails::Application\r\n  config.root = File.dirname(__FILE__)\r\n  config.logger = Logger.new($stdout)\r\n  Rails.logger  = config.logger\r\nend\r\n\r\n\r\nrequire 'minitest/autorun'\r\nrequire 'rack/test'\r\n\r\nclass BugTest < Minitest::Test\r\n  include Rack::Test::Methods\r\n\r\n  def test_params_transform_keys\r\n    # Works for a regular hash.\r\n    params = {\"a\" => \"b\"}\r\n    assert params.transform_keys(&:to_sym).keys.first.is_a? Symbol\r\n\r\n    # Does not work for AC::Params.\r\n    params = ActionController::Parameters.new(\"a\" => \"b\")\r\n    assert params.transform_keys(&:to_sym).keys.first.is_a? Symbol\r\n  end\r\n\r\n  private\r\n    def app\r\n      Rails.application\r\n    end\r\nend\r\n```"},"comment":{"url":"https://api.github.com/repos/rails/rails/issues/comments/182615330","html_url":"https://github.com/rails/rails/issues/23599#issuecomment-182615330","issue_url":"https://api.github.com/repos/rails/rails/issues/23599","id":182615330,"user":{"login":"why-el","id":1326771,"avatar_url":"https://avatars.githubusercontent.com/u/1326771?v=3","gravatar_id":"","url":"https://api.github.com/users/why-el","html_url":"https://github.com/why-el","followers_url":"https://api.github.com/users/why-el/followers","following_url":"https://api.github.com/users/why-el/following{/other_user}","gists_url":"https://api.github.com/users/why-el/gists{/gist_id}","starred_url":"https://api.github.com/users/why-el/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/why-el/subscriptions","organizations_url":"https://api.github.com/users/why-el/orgs","repos_url":"https://api.github.com/users/why-el/repos","events_url":"https://api.github.com/users/why-el/events{/privacy}","received_events_url":"https://api.github.com/users/why-el/received_events","type":"User","site_admin":false},"created_at":"2016-02-10T22:41:19Z","updated_at":"2016-02-10T22:41:19Z","body":"Ok, great. Thanks Rafael. "}}