[Fix #1479] Sanitize Administrateur email before validation

This commit is contained in:
Mathieu Magnin 2018-02-28 14:30:59 +01:00
parent d9c562c59d
commit 8731f7c63b

View file

@ -1,14 +1,16 @@
class Administrateur < ApplicationRecord
include CredentialsSyncableConcern
include EmailSanitizableConcern
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable
has_and_belongs_to_many :gestionnaires
has_many :procedures
before_validation -> { sanitize_email(:email) }
before_save :ensure_api_token
include CredentialsSyncableConcern
scope :inactive, -> { where(active: false) }
def self.find_inactive_by_token(reset_password_token)