update state date in aasm after callbacks

call aasm event methods, not state methods directly
This commit is contained in:
Christophe Robillard 2020-07-01 17:31:08 +02:00
parent 161b63f487
commit f631acd118
5 changed files with 52 additions and 41 deletions

View file

@ -149,7 +149,7 @@ module Users
errors = update_dossier_and_compute_errors
if passage_en_construction? && errors.blank?
@dossier.en_construction!
@dossier.passer_en_construction!
NotificationMailer.send_initiated_notification(@dossier).deliver_later
@dossier.groupe_instructeur.instructeurs.with_instant_email_dossier_notifications.each do |instructeur|
DossierMailer.notify_new_dossier_depose_to_instructeur(@dossier, instructeur.email).deliver_later