summaryrefslogtreecommitdiff
path: root/app/services/boards/destroy_service.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/services/boards/destroy_service.rb')
-rw-r--r--app/services/boards/destroy_service.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/app/services/boards/destroy_service.rb b/app/services/boards/destroy_service.rb
new file mode 100644
index 00000000000..ea0c1394aa3
--- /dev/null
+++ b/app/services/boards/destroy_service.rb
@@ -0,0 +1,11 @@
+# frozen_string_literal: true
+
+module Boards
+ class DestroyService < Boards::BaseService
+ def execute(board)
+ return false if parent.boards.size == 1
+
+ board.destroy
+ end
+ end
+end