提交 f620d6c2 编写于 作者: A Aaron Patterson

stop keeping track of keys when "deep munging"

This should have been done along with 8f8ccb99
上级 14e83772
......@@ -7,19 +7,17 @@ class Utils # :nodoc:
class << self
# Remove nils from the params hash
def deep_munge(hash, keys = [])
def deep_munge(hash)
return hash unless perform_deep_munge
hash.each do |k, v|
keys << k
case v
when Array
v.grep(Hash) { |x| deep_munge(x, keys) }
v.grep(Hash) { |x| deep_munge(x) }
v.compact!
when Hash
deep_munge(v, keys)
deep_munge(v)
end
keys.pop
end
hash
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册