Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-09-11 15:08:50 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-09-11 15:08:50 +0300
commit0eaa82ad61d2fda42b2dd5cf58cc08654b2d69ef (patch)
tree9ab5c60316dd689e0ac53830fd3910817006c9b3 /app/services/boards/destroy_service.rb
parent6b5f961bef87c70effe57b14d41f9ed882b5d296 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/services/boards/destroy_service.rb')
-rw-r--r--app/services/boards/destroy_service.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/app/services/boards/destroy_service.rb b/app/services/boards/destroy_service.rb
index ea0c1394aa3..8f3d4b58b7b 100644
--- a/app/services/boards/destroy_service.rb
+++ b/app/services/boards/destroy_service.rb
@@ -3,9 +3,13 @@
module Boards
class DestroyService < Boards::BaseService
def execute(board)
- return false if parent.boards.size == 1
+ 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
+ board.destroy!
+
+ ServiceResponse.success
end
end
end