Sha256: 0cea3a988e0cd4c89dfedf5eb346727ef2d77607de661819ac91ee48de8cd5c1
Contents?: true
Size: 502 Bytes
Versions: 113
Compression:
Stored size: 502 Bytes
Contents
# Patch from https://github.com/rails/rails/pull/8862 module ActionDispatch Request.class_eval do # Remove nils from the params hash def deep_munge(hash) hash ||= {} hash.each do |k, v| case v when Array if v.size > 0 && v.all?(&:nil?) hash[k] = nil next end v.grep(Hash) { |x| deep_munge(x) } v.compact! when Hash deep_munge(v) end end hash end end end
Version data entries
113 entries across 113 versions & 1 rubygems