[Fix #1479] Sanitize Gestionnaire email before validation
This commit is contained in:
parent
38e1609d73
commit
d9c562c59d
1 changed files with 5 additions and 2 deletions
|
@ -1,9 +1,14 @@
|
|||
class Gestionnaire < ApplicationRecord
|
||||
include CredentialsSyncableConcern
|
||||
include EmailSanitizableConcern
|
||||
|
||||
devise :database_authenticatable, :registerable,
|
||||
:recoverable, :rememberable, :trackable, :validatable
|
||||
|
||||
has_and_belongs_to_many :administrateurs
|
||||
|
||||
before_validation -> { sanitize_email(:email) }
|
||||
|
||||
has_many :assign_to, dependent: :destroy
|
||||
has_many :procedures, through: :assign_to
|
||||
has_many :dossiers, -> { state_not_brouillon }, through: :procedures
|
||||
|
@ -12,8 +17,6 @@ class Gestionnaire < ApplicationRecord
|
|||
has_many :avis
|
||||
has_many :dossiers_from_avis, through: :avis, source: :dossier
|
||||
|
||||
include CredentialsSyncableConcern
|
||||
|
||||
def visible_procedures
|
||||
procedures.publiees_ou_archivees
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue