debian-mirror-gitlab/app/services/boards/destroy_service.rb
2020-11-24 15:15:51 +05:30

15 lines
358 B
Ruby

# frozen_string_literal: true
module Boards
class DestroyService < Boards::BaseService
def execute(board)
if parent.boards.size == 1
return ServiceResponse.error(message: "The board could not be deleted, because the parent doesn't have any other boards.")
end
board.destroy!
ServiceResponse.success
end
end
end