mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-10-03 10:24:30 +08:00
Redundant notifications [SCI-9788]
This commit is contained in:
parent
b1b8059e41
commit
121cbe7471
2 changed files with 4 additions and 0 deletions
|
@ -534,6 +534,8 @@ class MyModulesController < ApplicationController
|
|||
users = User.where(id: params[:my_module][:user_ids])
|
||||
|
||||
users.each do |user|
|
||||
next if current_user.id == user.id
|
||||
|
||||
log_activity(:designate_user_to_my_module, @my_module, { user_target: user.id })
|
||||
end
|
||||
end
|
||||
|
|
|
@ -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 == user
|
||||
|
||||
Activities::CreateActivityService
|
||||
.call(activity_type: type_of,
|
||||
owner: current_user,
|
||||
|
|
Loading…
Add table
Reference in a new issue