diff options
author | Xavier Noria <fxn@hashref.com> | 2013-12-23 22:55:03 +0100 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2013-12-23 22:55:03 +0100 |
commit | fa0380cb4a7f08909e961a8e355c70ba3a676253 (patch) | |
tree | de4a1fad40391fbb8a74d845c4021b4a0724a99f /actionpack/lib/action_controller | |
parent | 33cb2f334db7d8c173a7f801a678fe5696169ed7 (diff) | |
download | rails-fa0380cb4a7f08909e961a8e355c70ba3a676253.tar.gz rails-fa0380cb4a7f08909e961a8e355c70ba3a676253.tar.bz2 rails-fa0380cb4a7f08909e961a8e355c70ba3a676253.zip |
AC::Parameters#permit! permits hashes in array values
Diffstat (limited to 'actionpack/lib/action_controller')
-rw-r--r-- | actionpack/lib/action_controller/metal/strong_parameters.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/actionpack/lib/action_controller/metal/strong_parameters.rb b/actionpack/lib/action_controller/metal/strong_parameters.rb index 41be1b121e..48a916f2b1 100644 --- a/actionpack/lib/action_controller/metal/strong_parameters.rb +++ b/actionpack/lib/action_controller/metal/strong_parameters.rb @@ -157,8 +157,10 @@ module ActionController # Person.new(params) # => #<Person id: nil, name: "Francesco"> def permit! each_pair do |key, value| - convert_hashes_to_parameters(key, value) - self[key].permit! if self[key].respond_to? :permit! + value = convert_hashes_to_parameters(key, value) + Array.wrap(value).each do |_| + _.permit! if _.respond_to? :permit! + end end @permitted = true |