Use of ParameterFilter changes `request.filtered_parameters` class to Hash

I’m following the “Contributing to Ruby on Rails” guide advice and posting here to get feedback and possibly get a Pull Request merged.

Issue URL: https://github.com/rails/rails/issues/27944

I initially posted an issue when I noticed that by using ParameterFilter (which is used by default, see initializer filter_parameter_logging.rb) I lost indifferent access on the params. I proposed to different ways to tackle the problem:

  1. Use ActiveSupport::HashWithIndifferentAccess every time.

  2. Use whatever class params is, arguing that filtering shouldn’t change the class.

Jon Moss provided some input, which encourage me to submit a PR with the second solution. That way, wether you use the ParameterFilter or not you can expect the result to be the same.

PR URL: https://github.com/rails/rails/pull/27990

Thanks again for keeping Rails great.