Refactor abilities. Added ProjectUpdate context. Fixed few bugs with namespaces

This commit is contained in:
Dmitriy Zaporozhets 2012-11-29 07:29:11 +03:00
parent a1ffc673b9
commit eb1004f789
18 changed files with 127 additions and 53 deletions

View file

@ -53,12 +53,14 @@ class Namespace < ActiveRecord::Base
end
def move_dir
old_path = File.join(Gitlab.config.git_base_path, path_was)
new_path = File.join(Gitlab.config.git_base_path, path)
if File.exists?(new_path)
raise "Already exists"
if path_changed?
old_path = File.join(Gitlab.config.git_base_path, path_was)
new_path = File.join(Gitlab.config.git_base_path, path)
if File.exists?(new_path)
raise "Already exists"
end
system("mv #{old_path} #{new_path}")
end
system("mv #{old_path} #{new_path}")
end
def rm_dir