Project destroy relationship speed fix
Removes destroy callback for users_projects when a project is destroyed. This works okay becaues the gitolite config will be updated at at the end to remove the entry entirely, thereby removing the users anyway.
This commit is contained in:
parent
ca4e2ad135
commit
0bd7f91c66
1 changed files with 4 additions and 0 deletions
|
@ -93,7 +93,11 @@ class ProjectsController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def destroy
|
def destroy
|
||||||
|
# Disable the UsersProject update_repository call, otherwise it will be
|
||||||
|
# called once for every person removed from the project
|
||||||
|
UsersProject.skip_callback(:destroy, :after, :update_repository)
|
||||||
project.destroy
|
project.destroy
|
||||||
|
UsersProject.set_callback(:destroy, :after, :update_repository)
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html { redirect_to projects_url }
|
format.html { redirect_to projects_url }
|
||||||
|
|
Loading…
Reference in a new issue