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

Version Path
katello-3.15.3.1 lib/monkeys/json_munging_patch.rb
katello-3.15.3 lib/monkeys/json_munging_patch.rb
katello-3.15.2 lib/monkeys/json_munging_patch.rb
katello-3.15.1.1 lib/monkeys/json_munging_patch.rb
katello-3.15.1 lib/monkeys/json_munging_patch.rb
katello-3.15.0.1 lib/monkeys/json_munging_patch.rb
katello-3.15.0 lib/monkeys/json_munging_patch.rb
katello-3.15.0.rc2 lib/monkeys/json_munging_patch.rb
katello-3.15.0.rc1.3 lib/monkeys/json_munging_patch.rb
katello-3.15.0.rc1.2 lib/monkeys/json_munging_patch.rb
katello-3.15.0.rc1.1 lib/monkeys/json_munging_patch.rb
katello-3.15.0.rc1 lib/monkeys/json_munging_patch.rb
katello-3.14.1 lib/monkeys/json_munging_patch.rb
katello-3.13.4 lib/monkeys/json_munging_patch.rb
katello-3.14.0 lib/monkeys/json_munging_patch.rb
katello-3.13.3 lib/monkeys/json_munging_patch.rb
katello-3.14.0.rc2 lib/monkeys/json_munging_patch.rb
katello-3.13.2 lib/monkeys/json_munging_patch.rb
katello-3.14.0.rc1 lib/monkeys/json_munging_patch.rb
katello-3.13.1 lib/monkeys/json_munging_patch.rb