demarches-normaliennes/app/services/accompagnateur_service.rb

20 lines
463 B
Ruby
Raw Normal View History

class AccompagnateurService
ASSIGN = 'assign'
NOT_ASSIGN = 'not_assign'
def initialize accompagnateur, procedure, to
@accompagnateur = accompagnateur
@procedure = procedure
@to = to
end
def change_assignement!
case @to
when ASSIGN
AssignTo.create(gestionnaire: @accompagnateur, procedure: @procedure)
when NOT_ASSIGN
2016-11-15 03:56:26 +01:00
AssignTo.where(gestionnaire: @accompagnateur, procedure: @procedure).delete_all
end
end
2017-04-04 15:27:04 +02:00
end