Exclude notification for dossier state draft and for accompagnateur comments
This commit is contained in:
parent
33362d1a52
commit
9a0a391c40
6 changed files with 21 additions and 5 deletions
|
@ -24,6 +24,8 @@ class Cerfa < ActiveRecord::Base
|
|||
private
|
||||
|
||||
def internal_notification
|
||||
NotificationService.new('cerfa', self.dossier.id).notify
|
||||
unless dossier.state == 'draft'
|
||||
NotificationService.new('cerfa', self.dossier.id).notify
|
||||
end
|
||||
end
|
||||
end
|
|
@ -52,6 +52,8 @@ class Champ < ActiveRecord::Base
|
|||
private
|
||||
|
||||
def internal_notification
|
||||
NotificationService.new('champs', self.dossier.id, self.libelle).notify
|
||||
unless dossier.state == 'draft'
|
||||
NotificationService.new('champs', self.dossier.id, self.libelle).notify
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -13,6 +13,8 @@ class Commentaire < ActiveRecord::Base
|
|||
private
|
||||
|
||||
def internal_notification
|
||||
NotificationService.new('commentaire', self.dossier.id).notify
|
||||
if email == dossier.user.email || dossier.invites.pluck(:email).to_a.include?(email)
|
||||
NotificationService.new('commentaire', self.dossier.id).notify
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -49,6 +49,8 @@ class PieceJustificative < ActiveRecord::Base
|
|||
private
|
||||
|
||||
def internal_notification
|
||||
NotificationService.new('piece_justificative', self.dossier.id, self.libelle).notify
|
||||
unless self.type_de_piece_justificative.nil? && dossier.state == 'draft'
|
||||
NotificationService.new('piece_justificative', self.dossier.id, self.libelle).notify
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue