[28908] Fix self reference in removal of categories

https://community.openproject.com/wp/28908
pull/6819/head
Oliver Günther 6 years ago
parent ba23937f53
commit 90c458d9c1
No known key found for this signature in database
GPG Key ID: A3A8BDAD7C0C552C
  1. 1
      app/models/group/destroy.rb

@ -93,6 +93,7 @@ module Group::Destroy
.joins("INNER JOIN #{members}
ON #{members}.project_id = categories.project_id
AND #{members}.user_id = categories.assigned_to_id")
.where("#{members}.user_id" => self.id)
.update_all "assigned_to_id = NULL"
self.users.delete_all # remove all users from this group

Loading…
Cancel
Save