From 5583fd33731e759186041b9d54cc284f325558a2 Mon Sep 17 00:00:00 2001 From: manu vasconcelos Date: Tue, 17 Dec 2024 13:48:25 -0300 Subject: [PATCH] don't try to relate if it's not a ProjectMedia --- app/models/concerns/smooch_messages.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/models/concerns/smooch_messages.rb b/app/models/concerns/smooch_messages.rb index 88913b58c..e9021fb52 100644 --- a/app/models/concerns/smooch_messages.rb +++ b/app/models/concerns/smooch_messages.rb @@ -430,6 +430,7 @@ def smoooch_post_save_message_actions(message, associated, app_id, author, reque end def smooch_relate_items_for_same_message(message, associated, app_id, author, request_type, associated_obj) + return if associated.class.name != 'ProjectMedia' if !message['caption'].blank? # Check if message contains caption then create an item and force relationship self.relate_item_and_text(message, associated, app_id, author, request_type, associated_obj, Relationship.confirmed_type)