diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2012-10-04 11:55:37 -0700 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2012-10-04 11:55:37 -0700 |
commit | afc81bc1bd4a668a86c303c24849bf5a74044f3b (patch) | |
tree | d17f47fe4d8e39c0bca64b50ac8b7f10730c5ab7 /actionpack/lib/action_controller | |
parent | a086e328d366f7586feb0e9b2fe028936bb950fd (diff) | |
parent | 1aa522dc4e00fdd54b1e1e38ad74311483849fcb (diff) | |
download | rails-afc81bc1bd4a668a86c303c24849bf5a74044f3b.tar.gz rails-afc81bc1bd4a668a86c303c24849bf5a74044f3b.tar.bz2 rails-afc81bc1bd4a668a86c303c24849bf5a74044f3b.zip |
Merge pull request #7847 from bloudermilk/recursive_permit
ActionController::Parameters#permit! is recursive
Diffstat (limited to 'actionpack/lib/action_controller')
-rw-r--r-- | actionpack/lib/action_controller/metal/strong_parameters.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/actionpack/lib/action_controller/metal/strong_parameters.rb b/actionpack/lib/action_controller/metal/strong_parameters.rb index c9a81e4866..36fce81d1c 100644 --- a/actionpack/lib/action_controller/metal/strong_parameters.rb +++ b/actionpack/lib/action_controller/metal/strong_parameters.rb @@ -112,6 +112,11 @@ module ActionController # params.permitted? # => true # 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! + end + @permitted = true self end |