feat(routing): create routing rule for dropdown other option
This commit is contained in:
parent
4749b43697
commit
7680d5093e
1 changed files with 13 additions and 3 deletions
|
@ -43,9 +43,19 @@ module Administrateurs
|
||||||
tdc_options = tdc.drop_down_options.reject(&:empty?)
|
tdc_options = tdc.drop_down_options.reject(&:empty?)
|
||||||
|
|
||||||
tdc_options.each do |option_label|
|
tdc_options.each do |option_label|
|
||||||
gi = @procedure.groupe_instructeurs.find_by({ label: option_label }) || @procedure.groupe_instructeurs
|
routing_rule = ds_eq(champ_value(stable_id), constant(option_label))
|
||||||
.create({ label: option_label, instructeurs: [current_administrateur.instructeur] })
|
@procedure
|
||||||
gi.update(routing_rule: ds_eq(champ_value(stable_id), constant(gi.label)))
|
.groupe_instructeurs
|
||||||
|
.find_or_create_by(label: option_label)
|
||||||
|
.update(instructeurs: [current_administrateur.instructeur], routing_rule:)
|
||||||
|
end
|
||||||
|
|
||||||
|
if tdc.drop_down_other?
|
||||||
|
routing_rule = ds_eq(champ_value(stable_id), constant(Champs::DropDownListChamp::OTHER))
|
||||||
|
@procedure
|
||||||
|
.groupe_instructeurs
|
||||||
|
.find_or_create_by(label: 'Autre')
|
||||||
|
.update(instructeurs: [current_administrateur.instructeur], routing_rule:)
|
||||||
end
|
end
|
||||||
|
|
||||||
@procedure.toggle_routing
|
@procedure.toggle_routing
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue