aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2017-05-11 13:43:02 -0700
committerGitHub <noreply@github.com>2017-05-11 13:43:02 -0700
commit4b969ea417f097d217ff1f662d2fe8c406d21b99 (patch)
tree90030492cdf677f5e4df23ec4c38eedae3dc27d8 /actionpack/lib/action_controller
parent358280d980685717fc49fb2f6cfb4a0507bfe23f (diff)
parentfb0fae9747ceec065e75867ea83afb713a5b449b (diff)
downloadrails-4b969ea417f097d217ff1f662d2fe8c406d21b99.tar.gz
rails-4b969ea417f097d217ff1f662d2fe8c406d21b99.tar.bz2
rails-4b969ea417f097d217ff1f662d2fe8c406d21b99.zip
Merge pull request #29040 from eugeneius/parameters_delete_block
Pass block in ActionController::Parameters#delete
Diffstat (limited to 'actionpack/lib/action_controller')
-rw-r--r--actionpack/lib/action_controller/metal/strong_parameters.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/actionpack/lib/action_controller/metal/strong_parameters.rb b/actionpack/lib/action_controller/metal/strong_parameters.rb
index 7864f9decd..20330b5091 100644
--- a/actionpack/lib/action_controller/metal/strong_parameters.rb
+++ b/actionpack/lib/action_controller/metal/strong_parameters.rb
@@ -666,8 +666,8 @@ module ActionController
# to key. If the key is not found, returns the default value. If the
# optional code block is given and the key is not found, pass in the key
# and return the result of block.
- def delete(key)
- convert_value_to_parameters(@parameters.delete(key))
+ def delete(key, &block)
+ convert_value_to_parameters(@parameters.delete(key, &block))
end
# Returns a new instance of <tt>ActionController::Parameters</tt> with only