def merge_protections(protections, protected_params)
      protected_params.each do |k,v|
        if protections[k].is_a?(Hash)
          merge_protections(protections[k], v) if v
        else
          protections[k] = v
        end
      end

      protections
    end
def merge_protections(protections, protected_params)
      protected_params.each do |k,v|
        if protections[k].is_a?(Hash)
          merge_protections(protections[k], v) if v
        else
          protections[k] = v
        end
      end

      protections
    end
Merge protections for the same params into one so as to allow extension of them
 in inheriting controllers.

 Mutating the first argument is okay since this method is used within inject only.

 Example:
 merge_protections({ :foo => { :qux => nil }, :bar => { :baz => nil, :qux => nil } },
                   { :foo => { :baz => nil, :qux => { :foo => nil } } })
 =>

 { :foo => { :baz => nil, :qux => { :foo => nil } }, :bar => { :baz =>nil, :qux => nil } }