Commit 0bd7f91c6608e7cd72349c89494103aed40be22d

Authored by Jeremy Mack
1 parent ca4e2ad1

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.
Showing 1 changed file with 4 additions and 0 deletions   Show diff stats
app/controllers/projects_controller.rb
... ... @@ -93,7 +93,11 @@ class ProjectsController < ApplicationController
93 93 end
94 94  
95 95 def destroy
  96 + # Disable the UsersProject update_repository call, otherwise it will be
  97 + # called once for every person removed from the project
  98 + UsersProject.skip_callback(:destroy, :after, :update_repository)
96 99 project.destroy
  100 + UsersProject.set_callback(:destroy, :after, :update_repository)
97 101  
98 102 respond_to do |format|
99 103 format.html { redirect_to projects_url }
... ...