Merge pull request #6750 from G-Chubinidze/gc_SCI_9788

Redundant notifications [SCI-9788]
This commit is contained in:
Martin Artnik 2023-12-05 14:57:01 +01:00 committed by GitHub
commit 31e55488a7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View file

@ -531,7 +531,7 @@ class MyModulesController < ApplicationController
end
def log_user_designation_activity
users = User.where(id: params[:my_module][:user_ids])
users = User.where.not(id: current_user.id).where(id: params[:my_module][:user_ids])
users.each do |user|
log_activity(:designate_user_to_my_module, @my_module, { user_target: user.id })

View file

@ -9,6 +9,8 @@ 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,