mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-27 02:04:33 +08:00
logic cleanup
This commit is contained in:
parent
121cbe7471
commit
70ed2cb868
2 changed files with 2 additions and 4 deletions
|
@ -531,11 +531,9 @@ 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|
|
||||
next if current_user.id == user.id
|
||||
|
||||
log_activity(:designate_user_to_my_module, @my_module, { user_target: user.id })
|
||||
end
|
||||
end
|
||||
|
|
|
@ -9,7 +9,7 @@ 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
|
||||
return if current_user.id == user.id
|
||||
|
||||
Activities::CreateActivityService
|
||||
.call(activity_type: type_of,
|
||||
|
|
Loading…
Reference in a new issue