chore: Add dependant destroy_async for sla events (#12774)

Added the destroy_async to prevent timeout during SLA policy deletion by
processing SLA events asynchronously.
This commit is contained in:
Muhsin Keloth
2025-10-31 09:19:56 +05:30
committed by GitHub
parent 6b87d6784e
commit 358a3924b8

View File

@@ -22,7 +22,7 @@ class AppliedSla < ApplicationRecord
belongs_to :sla_policy
belongs_to :conversation
has_many :sla_events, dependent: :destroy
has_many :sla_events, dependent: :destroy_async
validates :account_id, uniqueness: { scope: %i[sla_policy_id conversation_id] }
before_validation :ensure_account_id