feat(routing): serialize routing condition

This commit is contained in:
simon lehericey 2023-03-24 10:27:53 +01:00 committed by Eric Leroy-Terquem
parent 3ef6adccd6
commit 0ca7c805df

View file

@ -81,4 +81,20 @@ class GroupeInstructeur < ApplicationRecord
def toggle_routing def toggle_routing
procedure.update!(routing_enabled: procedure.groupe_instructeurs.active.many?) procedure.update!(routing_enabled: procedure.groupe_instructeurs.active.many?)
end end
class RoutingSerializer
def self.load(routing)
if routing.present?
Logic.from_h(routing)
end
end
def self.dump(routing)
if routing.present?
routing.to_h
end
end
end
serialize :routing, RoutingSerializer
end end