From 84dae4e4a9caa0abf210383372198a4d8cf1d58d Mon Sep 17 00:00:00 2001 From: Sojan Jose Date: Fri, 16 May 2025 16:59:43 -0700 Subject: [PATCH] fix: Move the check for CaptainAssistant to enterprise (#11500) --- app/models/concerns/activity_message_handler.rb | 4 ++-- .../app/models/enterprise/activity_message_handler.rb | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 enterprise/app/models/enterprise/activity_message_handler.rb diff --git a/app/models/concerns/activity_message_handler.rb b/app/models/concerns/activity_message_handler.rb index aa2b78e72..54e58b4d9 100644 --- a/app/models/concerns/activity_message_handler.rb +++ b/app/models/concerns/activity_message_handler.rb @@ -80,8 +80,6 @@ module ActivityMessageHandler def automation_status_change_activity_content if Current.executed_by.instance_of?(AutomationRule) I18n.t("conversations.activity.status.#{status}", user_name: I18n.t('automation.system_name')) - elsif Current.executed_by.instance_of?(Captain::Assistant) && resolved? - I18n.t('conversations.activity.captain.resolved', user_name: Current.executed_by.name) elsif Current.executed_by.instance_of?(Contact) Current.executed_by = nil I18n.t('conversations.activity.status.system_auto_open') @@ -128,3 +126,5 @@ module ActivityMessageHandler user_name end end + +ActivityMessageHandler.prepend_mod_with('ActivityMessageHandler') diff --git a/enterprise/app/models/enterprise/activity_message_handler.rb b/enterprise/app/models/enterprise/activity_message_handler.rb new file mode 100644 index 000000000..202884b5b --- /dev/null +++ b/enterprise/app/models/enterprise/activity_message_handler.rb @@ -0,0 +1,9 @@ +module Enterprise::ActivityMessageHandler + def automation_status_change_activity_content + if Current.executed_by.instance_of?(Captain::Assistant) && resolved? + I18n.t('conversations.activity.captain.resolved', user_name: Current.executed_by.name) + else + super + end + end +end