summaryrefslogtreecommitdiff
path: root/app/controllers/groups/boards_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/groups/boards_controller.rb')
-rw-r--r--app/controllers/groups/boards_controller.rb11
1 files changed, 8 insertions, 3 deletions
diff --git a/app/controllers/groups/boards_controller.rb b/app/controllers/groups/boards_controller.rb
index 7c2016f0326..e892d1f8dbf 100644
--- a/app/controllers/groups/boards_controller.rb
+++ b/app/controllers/groups/boards_controller.rb
@@ -2,19 +2,24 @@ class Groups::BoardsController < Groups::ApplicationController
include BoardsResponses
before_action :assign_endpoint_vars
+ before_action :boards, only: :index
def index
- @boards = Boards::ListService.new(group, current_user).execute
-
respond_with_boards
end
def show
- @board = group.boards.find(params[:id])
+ @board = boards.find(params[:id])
respond_with_board
end
+ private
+
+ def boards
+ @boards ||= Boards::ListService.new(group, current_user).execute
+ end
+
def assign_endpoint_vars
@boards_endpoint = group_boards_url(group)
@namespace_path = group.to_param