instance method
deep_munge
Ruby on Rails 3.2.22.5
Since v3.0.20 Last seen in v4.2.9Signature
deep_munge(hash)
Remove nils from the params hash
Parameters
-
hashreq
Source
# File actionpack/lib/action_dispatch/http/request.rb, line 257
def deep_munge(hash)
hash.each do |k, v|
case v
when Array
v.grep(Hash) { |x| deep_munge(x) }
v.compact!
hash[k] = nil if v.empty?
when Hash
deep_munge(v)
end
end
hash
end
Defined in actionpack/lib/action_dispatch/http/request.rb line 257
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionDispatch::Request