This project is archived and is in readonly mode.

#2851 ✓resolved
vicente.mundim (at gmail)

Filtering parameters inside arrays when logging

Reported by vicente.mundim (at gmail) | June 29th, 2009 @ 01:54 PM | in 2.x

I've stumbled upon this issue while creating an application which makes use of nested forms. Basically, I have an Account model which has many Users. When I create the account it also creates one User. The action receives parameters like:

:account => { :name => 'foo', :users_attributes => [{ :login => 'foo', :password => 'secret', :password_confirmation => 'secret' }] }

Since my controller has the following line:

filter_parameter_logging :password, :password_confirmation

I was expecting to see both password and password_confirmation filtered, but they weren't. Looking inside filter_parameter_logging I understand that it didn't treated arrays at all. I've made a patch, but it seems is down, so I'll just post it here. The patch contains changes to both code and tests. I've made it by branching origin/2-3-stable.

I think it may be wrong in older versions of rails too.

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href=""></a>