Skip to content
This repository
branch: tagged-docs
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 25 lines (22 sloc) 0.495 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
module ActionDispatch
  class Request < Rack::Request
    class Utils # :nodoc:
      class << self
        # Remove nils from the params hash
        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
      end
    end
  end
end

Something went wrong with that request. Please try again.