summaryrefslogtreecommitdiff
path: root/app/services/destroy_group_service.rb
blob: 3c42ac61be4e3e4ff070adcd6d404071d0a79cfe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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).pending_delete!
    end

    group.destroy
  end
end