refactor(routing): make toggle_routing public
This commit is contained in:
parent
2a3ffdf3c6
commit
5416ec8226
1 changed files with 5 additions and 5 deletions
|
@ -93,6 +93,11 @@ class GroupeInstructeur < ApplicationRecord
|
|||
procedure.groupe_instructeurs - [self]
|
||||
end
|
||||
|
||||
def toggle_routing
|
||||
procedure.update!(routing_enabled: procedure.groupe_instructeurs.active.many?)
|
||||
procedure.update!(instructeurs_self_management_enabled: true) if procedure.routing_enabled?
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def routing_rule_matches_tdc?
|
||||
|
@ -100,10 +105,5 @@ class GroupeInstructeur < ApplicationRecord
|
|||
routing_rule.right.value.in?(routing_tdc.options['drop_down_options'])
|
||||
end
|
||||
|
||||
def toggle_routing
|
||||
procedure.update!(routing_enabled: procedure.groupe_instructeurs.active.many?)
|
||||
procedure.update!(instructeurs_self_management_enabled: true) if procedure.routing_enabled?
|
||||
end
|
||||
|
||||
serialize :routing_rule, LogicSerializer
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue