Merge pull request #6576 from artoscinote/ma_SCI_8587

When unassigning users from task, also delete designated users [SCI-8587]
This commit is contained in:
Martin Artnik 2023-11-03 11:59:29 +01:00 committed by GitHub
commit b8f5ca90f8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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