From 21c2cf4e5c2dd40081793f29c5ce56ab4fd5fce6 Mon Sep 17 00:00:00 2001 From: Martin Artnik Date: Fri, 3 Nov 2023 11:49:06 +0100 Subject: [PATCH] When unassigning users from task, also delete designated users [SCI-8587] --- app/jobs/user_assignments/project_group_un_assignment_job.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/jobs/user_assignments/project_group_un_assignment_job.rb b/app/jobs/user_assignments/project_group_un_assignment_job.rb index 33fe1d8e7..d3be08aee 100644 --- a/app/jobs/user_assignments/project_group_un_assignment_job.rb +++ b/app/jobs/user_assignments/project_group_un_assignment_job.rb @@ -28,6 +28,7 @@ module UserAssignments .where(user_assignments: { user: users }) .where(projects: project) # rubocop:disable Rails/SkipsModelValidations + UserMyModule.where(user: users, my_module: my_modules).delete_all # remove designated users UserAssignment.where(assignable_type: 'MyModule', assignable_id: my_modules, user: users).delete_all my_modules.update_all(updated_at: Time.current) # rubocop:enable Rails/SkipsModelValidations