debian-mirror-gitlab/app/services/destroy_group_service.rb

18 lines
441 B
Ruby
Raw Normal View History

2015-09-11 14:41:01 +05:30
class DestroyGroupService
attr_accessor :group, :current_user
def initialize(group, user)
@group, @current_user = group, user
end
def execute
2016-06-02 11:05:42 +05:30
group.projects.each do |project|
2015-09-11 14:41:01 +05:30
# Skip repository removal because we remove directory with namespace
# that contain all this repositories
2016-04-02 18:10:28 +05:30
::Projects::DestroyService.new(project, current_user, skip_repo: true).pending_delete!
2015-09-11 14:41:01 +05:30
end
2016-06-02 11:05:42 +05:30
group.destroy
2015-09-11 14:41:01 +05:30
end
end