aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/metal
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2015-07-17 13:29:39 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2015-07-17 13:36:33 -0700
commit55d0e6f87719bb9a7040d59db7e5beaa6701e55e (patch)
tree0261c3f6b37065114706433062215f0b6dfdb1b6 /actionpack/lib/action_controller/metal
parent8c147bcdf79549fae46eedc3c4a5d9713f3faa27 (diff)
downloadrails-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.rb3
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: [] }.