From 358a3924b8d69a6ad51635585d2131d5241821ad Mon Sep 17 00:00:00 2001 From: Muhsin Keloth Date: Fri, 31 Oct 2025 09:19:56 +0530 Subject: [PATCH] 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. --- enterprise/app/models/applied_sla.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/enterprise/app/models/applied_sla.rb b/enterprise/app/models/applied_sla.rb index 6adeee036..112f9deea 100644 --- a/enterprise/app/models/applied_sla.rb +++ b/enterprise/app/models/applied_sla.rb @@ -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