Commentaire#internal_notification => #notify_gestionnaires

This commit is contained in:
gregoirenovel 2017-05-12 10:03:21 +02:00
parent c65b1e232a
commit cae3e1f420

View file

@ -4,7 +4,7 @@ class Commentaire < ActiveRecord::Base
belongs_to :piece_justificative belongs_to :piece_justificative
after_save :internal_notification after_save :notify_gestionnaires
def header def header
"#{email}, " + I18n.l(created_at.localtime, format: '%d %b %Y %H:%M') "#{email}, " + I18n.l(created_at.localtime, format: '%d %b %Y %H:%M')
@ -12,7 +12,7 @@ class Commentaire < ActiveRecord::Base
private private
def internal_notification def notify_gestionnaires
if email == dossier.user.email || dossier.invites_user.pluck(:email).to_a.include?(email) if email == dossier.user.email || dossier.invites_user.pluck(:email).to_a.include?(email)
NotificationService.new('commentaire', self.dossier.id).notify NotificationService.new('commentaire', self.dossier.id).notify
end end