Fix recipients for my_module designation notifications [SCI-9863]

This commit is contained in:
Martin Artnik 2023-12-11 14:32:37 +01:00
parent c0bc77024b
commit 7ba4efe30c
2 changed files with 4 additions and 2 deletions

View file

@ -9,8 +9,6 @@ class UserMyModule < ApplicationRecord
belongs_to :my_module, inverse_of: :user_my_modules, touch: true
def log_activity(type_of, current_user)
return if current_user.id == user.id
Activities::CreateActivityService
.call(activity_type: type_of,
owner: current_user,

View file

@ -7,7 +7,11 @@ module Recipients
def activity_recipients
activity = Activity.find(@params[:activity_id])
user = User.find_by(id: activity.values.dig('message_items', 'user_target', 'id'))
return [] if user.id == activity.owner_id
[user]
end
end
end