chore(routing): update routing_rule validation

This commit is contained in:
Eric Leroy-Terquem 2023-11-22 12:04:25 +01:00
parent f945c02c3c
commit a54d55486c
2 changed files with 2 additions and 2 deletions

View file

@ -92,7 +92,7 @@ class GroupeInstructeur < ApplicationRecord
end
def valid_rule_line?(rule)
([rule.left, rule, rule.right] in [ChampValue, (LessThan | LessThanEq | Eq | NotEq | GreaterThanEq | GreaterThan | IncludeOperator | ExcludeOperator), Constant]) && routing_rule_matches_tdc?(rule)
!rule.is_a?(EmptyOperator) && routing_rule_matches_tdc?(rule)
end
def non_unique_rule?

View file

@ -28,7 +28,7 @@ describe RoutingEngine, type: :model do
context 'without any matching rules' do
before do
procedure.groupe_instructeurs.each do |gi|
gi.update(routing_rule: ds_eq(constant(false), constant(false)))
gi.update(routing_rule: ds_eq(constant(false), constant(true)))
end
end