diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2012-11-21 08:54:05 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2012-11-21 08:54:05 +0300 |
commit | 70bf7f6e191c0e99ad03e1eec2ecbe2aae53fa09 (patch) | |
tree | 9ff90fbd30aa5386a543b770b0566aebb599b698 /app/models/namespace.rb | |
parent | cc52eed9816edb513482ec0db428e46c0bdce4c5 (diff) | |
download | gitlab-ce-70bf7f6e191c0e99ad03e1eec2ecbe2aae53fa09.tar.gz |
Project -> update repo only on create and destroy. Fixtures Updated with namespaces. Fixed moving repo
Diffstat (limited to 'app/models/namespace.rb')
-rw-r--r-- | app/models/namespace.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/app/models/namespace.rb b/app/models/namespace.rb index 013660406af..8eae36db8e2 100644 --- a/app/models/namespace.rb +++ b/app/models/namespace.rb @@ -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 |