Improve routing. Project access via namespace
This commit is contained in:
parent
a4d1bc1791
commit
26622f4c8f
4 changed files with 21 additions and 8 deletions
|
@ -1,13 +1,15 @@
|
|||
class ProjectObserver < ActiveRecord::Observer
|
||||
def after_save(project)
|
||||
project.update_repository
|
||||
|
||||
def before_save(project)
|
||||
# Move repository if namespace changed
|
||||
if project.namespace_id_changed?
|
||||
move_project(project)
|
||||
end
|
||||
end
|
||||
|
||||
def after_save(project)
|
||||
project.update_repository
|
||||
end
|
||||
|
||||
def after_destroy(project)
|
||||
log_info("Project \"#{project.name}\" was removed")
|
||||
|
||||
|
@ -35,7 +37,8 @@ class ProjectObserver < ActiveRecord::Observer
|
|||
old_path = File.join(Gitlab.config.git_base_path, old_dir, "#{project.path}.git")
|
||||
new_path = File.join(new_dir_path, "#{project.path}.git")
|
||||
|
||||
binding.pry
|
||||
`mv #{old_path} #{new_path}`
|
||||
|
||||
log_info "Project #{project.name} was moved from #{old_path} to #{new_path}"
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue