Rename gestionnaire in code to instructeur

This commit is contained in:
simon lehericey 2019-08-06 11:02:54 +02:00
parent 6902f84b85
commit 3fde2a6f70
175 changed files with 1162 additions and 1162 deletions

View file

@ -24,7 +24,7 @@ class Administrateurs::ActivateController < ApplicationController
if administrateur && administrateur.errors.empty?
sign_in(administrateur, scope: :administrateur)
try_to_authenticate(User, administrateur.email, password)
try_to_authenticate(Gestionnaire, administrateur.email, password)
try_to_authenticate(Instructeur, administrateur.email, password)
flash.notice = "Mot de passe enregistré"
redirect_to admin_procedures_path
else

View file

@ -1,6 +1,6 @@
class Administrateurs::PasswordsController < Devise::PasswordsController
after_action :try_to_authenticate_user, only: [:update]
after_action :try_to_authenticate_gestionnaire, only: [:update]
after_action :try_to_authenticate_instructeur, only: [:update]
# GET /resource/password/new
# def new
@ -44,12 +44,12 @@ class Administrateurs::PasswordsController < Devise::PasswordsController
end
end
def try_to_authenticate_gestionnaire
def try_to_authenticate_instructeur
if administrateur_signed_in?
gestionnaire = Gestionnaire.find_by(email: current_administrateur.email)
instructeur = Instructeur.find_by(email: current_administrateur.email)
if gestionnaire
sign_in gestionnaire
if instructeur
sign_in instructeur
end
end
end