class ActionController::Parameters

def compact

Returns a new +ActionController::Parameters+ instance with +nil+ values removed.
def compact
  new_instance_with_inherited_permitted_status(@parameters.compact)
end