2015-06-03 08:07:20 -04:00
|
|
|
class DestroyGroupService
|
|
|
|
attr_accessor :group, :current_user
|
|
|
|
|
|
|
|
def initialize(group, user)
|
|
|
|
@group, @current_user = group, user
|
|
|
|
end
|
|
|
|
|
|
|
|
def execute
|
2016-02-25 03:20:28 -05:00
|
|
|
group.projects.each do |project|
|
2015-06-03 10:16:27 -04:00
|
|
|
# Skip repository removal because we remove directory with namespace
|
|
|
|
# that contain all this repositories
|
2016-01-22 14:13:37 -05:00
|
|
|
::Projects::DestroyService.new(project, current_user, skip_repo: true).pending_delete!
|
2015-06-03 08:57:12 -04:00
|
|
|
end
|
|
|
|
|
2016-02-25 03:20:28 -05:00
|
|
|
group.destroy
|
2015-06-03 08:07:20 -04:00
|
|
|
end
|
|
|
|
end
|