mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-25 01:03:18 +08:00
Also delete user_my_modules when deleting MyModule assignments [SCI-6252] (#3651)
This commit is contained in:
parent
9ad287e994
commit
9181be22c8
1 changed files with 3 additions and 0 deletions
|
@ -50,6 +50,9 @@ module UserAssignments
|
|||
end
|
||||
|
||||
def destroy_user_assignment(object)
|
||||
# also destroy user designations if it's a MyModule
|
||||
object.user_my_modules.where(user: @user).destroy_all if object.is_a?(MyModule)
|
||||
|
||||
UserAssignment.where(user: @user, assignable: object).destroy_all
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue