feat(gallery): notify instructeur if pieces jointes added in avis
This commit is contained in:
parent
8d8e290659
commit
ad98bafeca
3 changed files with 9 additions and 3 deletions
|
@ -104,7 +104,12 @@ module Experts
|
|||
updated_recently = @avis.updated_recently?
|
||||
if @avis.update(avis_params)
|
||||
flash.notice = 'Votre réponse est enregistrée.'
|
||||
@avis.dossier.update!(last_avis_updated_at: Time.zone.now)
|
||||
|
||||
timestamps = [:last_avis_updated_at, :updated_at]
|
||||
timestamps << :last_avis_piece_jointe_updated_at if @avis.piece_justificative_file.attached?
|
||||
|
||||
@avis.dossier.touch(*timestamps)
|
||||
|
||||
if !updated_recently
|
||||
@avis.dossier.followers_instructeurs
|
||||
.with_instant_expert_avis_email_notifications_enabled
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue