Commentaire#notify_user_with_mail -> #notify_user

This commit is contained in:
gregoirenovel 2017-05-10 10:56:30 +02:00
parent 9c3cde2b2e
commit c07b83b266

View file

@ -5,7 +5,7 @@ class Commentaire < ActiveRecord::Base
belongs_to :piece_justificative
after_save :notify_gestionnaires
after_save :notify_user_with_mail
after_save :notify_user
def header
"#{email}, " + I18n.l(created_at.localtime, format: '%d %b %Y %H:%M')
@ -19,7 +19,7 @@ class Commentaire < ActiveRecord::Base
end
end
def notify_user_with_mail
def notify_user
NotificationMailer.new_answer(dossier).deliver_now! unless (current_user.try(:email) == dossier.user.email || email == 'contact@tps.apientreprise.fr')
end
end