diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2018-04-02 10:34:08 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-02 10:34:08 -0700 |
commit | 073168358740b33831f0963242ba1de1d0ddb0cc (patch) | |
tree | b5a4cb4cc6d9cebc8cb342f0272f99b1ba1118c4 /actionpack/lib | |
parent | 91f4e335b59a794e1f1d5c2a13b286c38aec9f85 (diff) | |
parent | d65d74b9158acf1ca79508a4ed49ffc712bdb983 (diff) | |
download | rails-073168358740b33831f0963242ba1de1d0ddb0cc.tar.gz rails-073168358740b33831f0963242ba1de1d0ddb0cc.tar.bz2 rails-073168358740b33831f0963242ba1de1d0ddb0cc.zip |
Merge pull request #32336 from vincedevendra/allow_mutating_dig_return_value
Make mutating params#dig return value mutate underlying params
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_controller/metal/strong_parameters.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/metal/strong_parameters.rb b/actionpack/lib/action_controller/metal/strong_parameters.rb index 75ca282804..4789252550 100644 --- a/actionpack/lib/action_controller/metal/strong_parameters.rb +++ b/actionpack/lib/action_controller/metal/strong_parameters.rb @@ -590,7 +590,8 @@ module ActionController # params2 = ActionController::Parameters.new(foo: [10, 11, 12]) # params2.dig(:foo, 1) # => 11 def dig(*keys) - convert_value_to_parameters(@parameters.dig(*keys)) + convert_hashes_to_parameters(keys.first, @parameters[keys.first]) + @parameters.dig(*keys) end # Returns a new <tt>ActionController::Parameters</tt> instance that |