User: eager load instructeur and administrateur to remove 2 db requests per http request

This commit is contained in:
simon lehericey 2019-09-26 11:45:38 +02:00
parent 5143d341ec
commit 3e0f1b9c66

View file

@ -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