refactor: simplify bot takeover callback order

This commit is contained in:
Sojan Jose
2026-07-02 22:40:06 -07:00
parent 0848c40c0f
commit 98592b6e62
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -3,7 +3,7 @@ module AssignmentHandler
include Events::Types
included do
before_validation :ensure_assignee_is_from_team
before_save :ensure_assignee_is_from_team
after_commit :notify_assignment_change, :process_assignment_changes
end
+1 -1
View File
@@ -66,7 +66,6 @@ class Conversation < ApplicationRecord
validates :inbox_id, presence: true
validates :contact_id, presence: true
before_validation :validate_additional_attributes
before_validation :handle_agent_bot_takeover_by_assignee
validates :additional_attributes, jsonb_attributes_length: true
validates :custom_attributes, jsonb_attributes_length: true
validates :uuid, uniqueness: true
@@ -117,6 +116,7 @@ class Conversation < ApplicationRecord
has_many :attachments, through: :messages
has_many :reporting_events, dependent: :destroy_async
before_save :handle_agent_bot_takeover_by_assignee
before_save :ensure_snooze_until_reset
before_create :determine_conversation_status
before_create :ensure_waiting_since