diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2015-07-17 13:29:39 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2015-07-17 13:36:33 -0700 |
commit | 55d0e6f87719bb9a7040d59db7e5beaa6701e55e (patch) | |
tree | 0261c3f6b37065114706433062215f0b6dfdb1b6 /actionpack/lib/action_controller/metal | |
parent | 8c147bcdf79549fae46eedc3c4a5d9713f3faa27 (diff) | |
download | rails-55d0e6f87719bb9a7040d59db7e5beaa6701e55e.tar.gz rails-55d0e6f87719bb9a7040d59db7e5beaa6701e55e.tar.bz2 rails-55d0e6f87719bb9a7040d59db7e5beaa6701e55e.zip |
push key checking up
We should disconnect `array_of_permitted_scalars_filter` from the
instance so that we can make hash filtering functional. For now, pull
the conditional up out of that method
Diffstat (limited to 'actionpack/lib/action_controller/metal')
-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 4c979ad4ec..a989641cdb 100644 --- a/actionpack/lib/action_controller/metal/strong_parameters.rb +++ b/actionpack/lib/action_controller/metal/strong_parameters.rb @@ -649,7 +649,7 @@ module ActionController end def array_of_permitted_scalars_filter(params, key) - if has_key?(key) && array_of_permitted_scalars?(self[key]) + if array_of_permitted_scalars?(self[key]) params[key] = self[key] end end @@ -661,6 +661,7 @@ module ActionController # Slicing filters out non-declared keys. slice(*filter.keys).each do |key, value| next unless value + next unless has_key? key if filter[key] == EMPTY_ARRAY # Declaration { comment_ids: [] }. |