class ActionController::Parameters

def each_element(object, filter, &block)

def each_element(object, filter, &block)
  case object
  when Array
    object.grep(Parameters).filter_map(&block)
  when Parameters
    if object.nested_attributes? && !specify_numeric_keys?(filter)
      object.each_nested_attribute(&block)
    else
      yield object
    end
  end
end