Skip to content

Commit

Permalink
Merge pull request #1614 from dmitry-sinina/rate_delta_max_validator
Browse files Browse the repository at this point in the history
routing plan: add validation for rate_delta_max
  • Loading branch information
dmitry-sinina authored Nov 13, 2024
2 parents 4f8de5d + 8705531 commit a352fc0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/models/routing/routing_plan.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a352fc0

Please sign in to comment.