Project can be transfered to namespace and out now
This commit is contained in:
parent
d405c8fc60
commit
f997947664
3 changed files with 16 additions and 13 deletions
|
@ -226,4 +226,18 @@ class Project < ActiveRecord::Base
|
|||
def code
|
||||
path
|
||||
end
|
||||
|
||||
def transfer(new_namespace)
|
||||
Project.transaction do
|
||||
old_namespace = namespace
|
||||
self.namespace = new_namespace
|
||||
|
||||
old_dir = old_namespace.try(:path) || ''
|
||||
new_dir = new_namespace.try(:path) || ''
|
||||
|
||||
Gitlab::ProjectMover.new(self, old_dir, new_dir).execute
|
||||
|
||||
save!
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue