refactor: simplify bot takeover callback order
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user