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
|
2015-06-03 08:57:12 -04:00
|
|
|
# TODO: Skip remove repository so Namespace#rm_dir works
|
|
|
|
@group.projects.each do |project|
|
|
|
|
::Projects::DestroyService.new(project, current_user, {}).execute
|
|
|
|
end
|
|
|
|
|
2015-06-03 08:07:20 -04:00
|
|
|
@group.destroy
|
|
|
|
end
|
|
|
|
end
|