Skip to content

Commit

Permalink
move return unless associated_obj.is_a?(ProjectMedia)
Browse files Browse the repository at this point in the history
this was causing two tests to fail, so we moved this directly before
Relationship.creation
  • Loading branch information
vasconsaurus committed Dec 18, 2024
1 parent fa55c4c commit 37f1897
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/concerns/smooch_messages.rb
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,6 @@ def smooch_post_save_message_actions(message, associated, app_id, author, reques
end

def smooch_relate_items_for_same_message(message, associated, app_id, author, request_type, associated_obj)
return unless associated_obj.is_a?(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)
Expand All @@ -457,6 +456,7 @@ def relate_item_and_text(message, associated, app_id, author, request_type, asso
target = self.create_project_media_from_message(message)
unless target.nil?
smooch_post_save_message_actions(message, target, app_id, author, request_type, associated_obj)
return unless associated_obj.is_a?(ProjectMedia)
Relationship.create_unless_exists(associated.id, target.id, relationship_type)
end
end
Expand Down

0 comments on commit 37f1897

Please sign in to comment.