gitlab-org--gitlab-foss/app/services/destroy_group_service.rb
Dmitriy Zaporozhets 53a0ac4734
Skip repo removing whem remove user or group
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-06-03 16:16:27 +02:00

17 lines
435 B
Ruby

class DestroyGroupService
attr_accessor :group, :current_user
def initialize(group, user)
@group, @current_user = group, user
end
def execute
@group.projects.each do |project|
# Skip repository removal because we remove directory with namespace
# that contain all this repositories
::Projects::DestroyService.new(project, current_user, skip_repo: true).execute
end
@group.destroy
end
end