diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2015-07-21 17:49:30 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2015-07-21 17:49:30 -0700 |
commit | 14e8377232adb3b92a84bb797915914bbbd75309 (patch) | |
tree | b71ca62dea485009c353237456693876b7a072a5 | |
parent | 5046d5179e9627bb84962f7ebf2153bfac6db254 (diff) | |
download | rails-14e8377232adb3b92a84bb797915914bbbd75309.tar.gz rails-14e8377232adb3b92a84bb797915914bbbd75309.tar.bz2 rails-14e8377232adb3b92a84bb797915914bbbd75309.zip |
recurse for arrays in `normalize_encode_params`
this just pushes the conditional in to the case / when so we can switch
to method dispatch later
-rw-r--r-- | actionpack/lib/action_dispatch/http/parameters.rb | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/actionpack/lib/action_dispatch/http/parameters.rb b/actionpack/lib/action_dispatch/http/parameters.rb index c2f05ecc86..b3633015b5 100644 --- a/actionpack/lib/action_dispatch/http/parameters.rb +++ b/actionpack/lib/action_dispatch/http/parameters.rb @@ -38,16 +38,14 @@ module ActionDispatch # def normalize_encode_params(params) case params + when Array + params.map! { |el| normalize_encode_params(el) } when Hash if params.has_key?(:tempfile) UploadedFile.new(params) else params.each_with_object({}) do |(key, val), new_hash| - new_hash[key] = if val.is_a?(Array) - val.map! { |el| normalize_encode_params(el) } - else - normalize_encode_params(val) - end + new_hash[key] = normalize_encode_params(val) end.with_indifferent_access end else |