2018-05-31 15:18:06 +02:00
|
|
|
module Manager
|
|
|
|
class DossiersController < Manager::ApplicationController
|
2018-07-02 11:46:04 +02:00
|
|
|
def change_state_to_instruction
|
|
|
|
dossier = Dossier.find(params[:id])
|
|
|
|
dossier.update(state: 'en_instruction', processed_at: nil, motivation: nil)
|
|
|
|
dossier.attestation&.destroy
|
|
|
|
logger.info("Le dossier #{dossier.id} est repassé en instruction par #{current_administration.email}")
|
|
|
|
flash[:notice] = "Le dossier #{dossier.id} est repassé en instruction"
|
|
|
|
redirect_to manager_dossier_path(dossier)
|
|
|
|
end
|
2018-05-31 15:18:06 +02:00
|
|
|
end
|
|
|
|
end
|