diff --git a/app/models/user.rb b/app/models/user.rb index 1f5217767..c49cd2718 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -21,6 +21,8 @@ class User < ApplicationRecord accepts_nested_attributes_for :france_connect_information + default_scope { eager_load(:instructeur, :administrateur) } + before_validation -> { sanitize_email(:email) } # Callback provided by Devise