diff options
author | Sergio Romano <sromano@stelladot.com> | 2014-06-13 14:42:38 -0300 |
---|---|---|
committer | Sergio Romano <sromano@stelladot.com> | 2014-06-13 14:42:38 -0300 |
commit | 540d1535316d6ecbe755ee66dfcbc23dc0bde3a5 (patch) | |
tree | 4aa86144d8bb15ad872860ed82ae88513c869e5c /actionpack/lib | |
parent | 0bfdf4087047cf7ef72fa10d07baecadefc53b70 (diff) | |
download | rails-540d1535316d6ecbe755ee66dfcbc23dc0bde3a5.tar.gz rails-540d1535316d6ecbe755ee66dfcbc23dc0bde3a5.tar.bz2 rails-540d1535316d6ecbe755ee66dfcbc23dc0bde3a5.zip |
ActionController::Parameters#require now accepts FalseClass values
Fixes #15685.
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_controller/metal/strong_parameters.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/actionpack/lib/action_controller/metal/strong_parameters.rb b/actionpack/lib/action_controller/metal/strong_parameters.rb index c3c3e4c4f1..0fc5680dcc 100644 --- a/actionpack/lib/action_controller/metal/strong_parameters.rb +++ b/actionpack/lib/action_controller/metal/strong_parameters.rb @@ -184,6 +184,7 @@ module ActionController # ActionController::Parameters.new(person: {}).require(:person) # # => ActionController::ParameterMissing: param not found: person def require(key) + return false if self[key].is_a? FalseClass self[key].presence || raise(ParameterMissing.new(key)) end |