class ActionController::Parameters

def array_of_permitted_scalars?(value)

def array_of_permitted_scalars?(value)
  if value.is_a?(Array) && value.all? { |element| permitted_scalar?(element) }
    yield value
  end
end