demarches-normaliennes/app/services/accompagnateur_service.rb

12 lines
354 B
Ruby
Raw Normal View History

class AccompagnateurService
ASSIGN = 'assign'
NOT_ASSIGN = 'not_assign'
def self.change_assignement! accompagnateur, procedure, to
if to == ASSIGN
AssignTo.create(gestionnaire: accompagnateur, procedure: procedure)
elsif to == NOT_ASSIGN
AssignTo.delete_all(gestionnaire: accompagnateur, procedure: procedure)
end
end
end