From 8705531efa0ce098dd77dc0bb5993b940dd1d8f6 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Wed, 13 Nov 2024 13:19:30 +0200 Subject: [PATCH] routing plan: add validation for rate_delta_max --- app/models/routing/routing_plan.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models/routing/routing_plan.rb b/app/models/routing/routing_plan.rb index 8bfde39ac..c770e869f 100644 --- a/app/models/routing/routing_plan.rb +++ b/app/models/routing/routing_plan.rb @@ -64,9 +64,10 @@ class Routing::RoutingPlan < ApplicationRecord include WithPaperTrail - validates :name, :max_rerouting_attempts, presence: true + validates :name, :max_rerouting_attempts, :rate_delta_max, presence: true validates :name, uniqueness: { allow_blank: false } validates :max_rerouting_attempts, numericality: { greater_than: 0, less_than_or_equal_to: 30, allow_nil: false, only_integer: true } + validates :rate_delta_max, numericality: { greater_than_or_equal_to: 0, allow_nil: false } validates :external_id, uniqueness: { allow_blank: true } validates :sorting_id, inclusion: { in: SORTINGS.keys }, allow_nil: false