Project -> update repo only on create and destroy. Fixtures Updated with namespaces. Fixed moving repo

This commit is contained in:
Dmitriy Zaporozhets 2012-11-21 08:54:05 +03:00
parent cc52eed981
commit 70bf7f6e19
11 changed files with 45 additions and 31 deletions

View file

@ -27,6 +27,7 @@ class Namespace < ActiveRecord::Base
after_create :ensure_dir_exist
after_update :move_dir
after_destroy :rm_dir
scope :root, where('type IS NULL')
@ -52,4 +53,9 @@ class Namespace < ActiveRecord::Base
new_path = File.join(Gitlab.config.git_base_path, path)
system("mv #{old_path} #{new_path}")
end
def rm_dir
dir_path = File.join(Gitlab.config.git_base_path, path)
system("rm -rf #{dir_path}")
end
end