def assign_from_old(params, new_params)
      queued_deletes = []

      params.attributes.each_pair do |name, old_val|
        # If there is a new value, see if it has [name]
        new_val = new_params ? new_params[name] : nil

        if !new_val
          # Queues the delete until after we finish the each_pair loop
          queued_deletes << name
        elsif new_val.is_a?(Hash)
          assign_from_old(old_val, new_val)
        else
          # assign value
          params.set(name, new_val) if old_val != new_val
          new_params.delete(name)
        end
      end

      queued_deletes.each { |name| params.delete(name) }
    end
def assign_from_old(params, new_params)
      queued_deletes = []

      params.attributes.each_pair do |name, old_val|
        # If there is a new value, see if it has [name]
        new_val = new_params ? new_params[name] : nil

        if !new_val
          # Queues the delete until after we finish the each_pair loop
          queued_deletes << name
        elsif new_val.is_a?(Hash)
          assign_from_old(old_val, new_val)
        else
          # assign value
          params.set(name, new_val) if old_val != new_val
          new_params.delete(name)
        end
      end

      queued_deletes.each { |name| params.delete(name) }
    end
Loop through the old params, and overwrite any existing values,
 and delete the values that don't exist in the new params.  Also
 remove any assigned to the new params (query_hash)