diff options
Diffstat (limited to 'app/services/boards/destroy_service.rb')
-rw-r--r-- | app/services/boards/destroy_service.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/app/services/boards/destroy_service.rb b/app/services/boards/destroy_service.rb index 8f3d4b58b7b..0b1cd61b119 100644 --- a/app/services/boards/destroy_service.rb +++ b/app/services/boards/destroy_service.rb @@ -3,7 +3,7 @@ module Boards class DestroyService < Boards::BaseService def execute(board) - if parent.boards.size == 1 + if boards.size == 1 return ServiceResponse.error(message: "The board could not be deleted, because the parent doesn't have any other boards.") end @@ -11,5 +11,11 @@ module Boards ServiceResponse.success end + + private + + def boards + parent.boards + end end end |