Chore: Replaced dependent destroy with dependent destroy_async in all models (#3249)

This commit is contained in:
Akhil G Krishnan
2021-11-18 10:32:29 +05:30
committed by GitHub
parent 4eeaadbd5b
commit b81a9f2010
23 changed files with 90 additions and 90 deletions

View File

@@ -38,12 +38,12 @@ class Contact < ApplicationRecord
format: { with: /\+[1-9]\d{1,14}\z/, message: 'should be in e164 format' }
belongs_to :account
has_many :conversations, dependent: :destroy
has_many :contact_inboxes, dependent: :destroy
has_many :csat_survey_responses, dependent: :destroy
has_many :conversations, dependent: :destroy_async
has_many :contact_inboxes, dependent: :destroy_async
has_many :csat_survey_responses, dependent: :destroy_async
has_many :inboxes, through: :contact_inboxes
has_many :messages, as: :sender, dependent: :destroy
has_many :notes, dependent: :destroy
has_many :messages, as: :sender, dependent: :destroy_async
has_many :notes, dependent: :destroy_async
before_validation :prepare_email_attribute
after_create_commit :dispatch_create_event, :ip_lookup