logic cleanup

This commit is contained in:
Giga Chubinidze 2023-12-05 12:06:58 +04:00
parent 121cbe7471
commit 70ed2cb868
2 changed files with 2 additions and 4 deletions

View file

@ -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

View file

@ -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,