use after_create instead of after_save

This commit is contained in:
clemkeirua 2020-09-28 17:38:49 +02:00 committed by Keirua (Rebase PR Action)
parent d23b1136ad
commit 4fc038fe1b
2 changed files with 2 additions and 2 deletions

View file

@ -308,7 +308,7 @@ class Dossier < ApplicationRecord
after_save :send_dossier_received
after_save :send_web_hook
after_save_commit :send_draft_notification_email
after_create_commit :send_draft_notification_email
validates :user, presence: true
validates :individual, presence: true, if: -> { revision.procedure.for_individual? }

View file

@ -19,7 +19,7 @@ class Invite < ApplicationRecord
before_validation -> { sanitize_email(:email) }
after_save_commit :send_notification
after_create_commit :send_notification
validates :email, presence: true
validates :email, uniqueness: { scope: :dossier_id }