Refactor Commentaire#notify_user

This commit is contained in:
gregoirenovel 2017-05-12 13:44:40 +02:00
parent c07b83b266
commit 1235fce34a

View file

@ -20,6 +20,8 @@ class Commentaire < ActiveRecord::Base
end
def notify_user
NotificationMailer.new_answer(dossier).deliver_now! unless (current_user.try(:email) == dossier.user.email || email == 'contact@tps.apientreprise.fr')
if email != dossier.user.email && email != 'contact@tps.apientreprise.fr'
NotificationMailer.new_answer(dossier).deliver_now!
end
end
end