diff options
Diffstat (limited to 'app/services/boards/list_service.rb')
-rw-r--r-- | app/services/boards/list_service.rb | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/app/services/boards/list_service.rb b/app/services/boards/list_service.rb index c6dfd62804f..729bca6580e 100644 --- a/app/services/boards/list_service.rb +++ b/app/services/boards/list_service.rb @@ -5,13 +5,7 @@ module Boards def execute(create_default_board: true) create_board! if create_default_board && parent.boards.empty? - if parent.multiple_issue_boards_available? - boards - else - # When multiple issue boards are not available - # a user is only allowed to view the default shown board - first_board - end + find_boards end private @@ -27,5 +21,18 @@ module Boards def create_board! Boards::CreateService.new(parent, current_user).execute end + + def find_boards + found = + if parent.multiple_issue_boards_available? + boards + else + # When multiple issue boards are not available + # a user is only allowed to view the default shown board + first_board + end + + params[:board_id].present? ? [found.find(params[:board_id])] : found + end end end |