Permalink
Browse files

When a repository is deleted rm -rf the location of the repository.

  • Loading branch information...
1 parent ad01193 commit dbdb6ed9e38e510d0e85cf6da8eeb3073ee46535 @icefox committed May 6, 2010
Showing with 8 additions and 0 deletions.
  1. +8 −0 web/app/models/repository.rb
@@ -1,4 +1,5 @@
require 'grit'
+require 'fileutils'
class Repository < ActiveRecord::Base
belongs_to :user
@@ -55,6 +56,13 @@ def copy(other)
self.forked_repository_id = other.id
end
+ def destroy
+ super
+ if File.exists?(location())
+ FileUtils.rm_rf location()
+ end
+ end
+
private
def existing_branch_name
if self.defaultbranch.empty?

0 comments on commit dbdb6ed

Please sign in to comment.