Envoie une notif aux followers_instructeurs le souhaitant

après chaque message déposé par l'usager
This commit is contained in:
Christophe Robillard 2020-04-02 10:18:23 +02:00
parent 415d5c765e
commit 969478b706
7 changed files with 46 additions and 13 deletions

View file

@ -19,6 +19,10 @@ class Instructeur < ApplicationRecord
has_one :user, dependent: :nullify
scope :with_instant_email_message_notifications, -> {
includes(:assign_to).where(assign_tos: { instant_email_message_notifications_enabled: true })
}
default_scope { eager_load(:user) }
def self.by_email(email)