mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-10-05 11:24:42 +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 = User.where(id: params[:my_module][:user_ids])
|
||||||
|
|
||||||
users.each do |user|
|
users.each do |user|
|
||||||
|
next if current_user.id == user.id
|
||||||
|
|
||||||
log_activity(:designate_user_to_my_module, @my_module, { user_target: user.id })
|
log_activity(:designate_user_to_my_module, @my_module, { user_target: user.id })
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -9,6 +9,8 @@ class UserMyModule < ApplicationRecord
|
||||||
belongs_to :my_module, inverse_of: :user_my_modules, touch: true
|
belongs_to :my_module, inverse_of: :user_my_modules, touch: true
|
||||||
|
|
||||||
def log_activity(type_of, current_user)
|
def log_activity(type_of, current_user)
|
||||||
|
return if current_user == user
|
||||||
|
|
||||||
Activities::CreateActivityService
|
Activities::CreateActivityService
|
||||||
.call(activity_type: type_of,
|
.call(activity_type: type_of,
|
||||||
owner: current_user,
|
owner: current_user,
|
||||||
|
|
Loading…
Add table
Reference in a new issue