Fix admin deletion by an administration

This commit is contained in:
simon lehericey 2019-08-19 10:47:37 +02:00
parent 6e83f3d524
commit ebe871819d
3 changed files with 16 additions and 2 deletions

View file

@ -8,7 +8,7 @@ class Administrateur < ApplicationRecord
has_many :services
has_many :dossiers, -> { state_not_brouillon }, through: :procedures
has_one :user
has_one :user, dependent: :nullify
before_validation -> { sanitize_email(:email) }