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

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

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

Leonel Galan Recinos
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.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/d/optout.
Loading...