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:
Diffstat (limited to 'app/controllers/projects/boards_controller.rb')
-rw-r--r--app/controllers/projects/boards_controller.rb9
1 files changed, 6 insertions, 3 deletions
diff --git a/app/controllers/projects/boards_controller.rb b/app/controllers/projects/boards_controller.rb
index 949e54ff819..e7354a9e1f7 100644
--- a/app/controllers/projects/boards_controller.rb
+++ b/app/controllers/projects/boards_controller.rb
@@ -4,22 +4,25 @@ class Projects::BoardsController < Projects::ApplicationController
before_action :check_issues_available!
before_action :authorize_read_board!, only: [:index, :show]
+ before_action :boards, only: :index
before_action :assign_endpoint_vars
def index
- @boards = Boards::ListService.new(project, current_user).execute
-
respond_with_boards
end
def show
- @board = project.boards.find(params[:id])
+ @board = boards.find(params[:id])
respond_with_board
end
private
+ def boards
+ @boards ||= Boards::ListService.new(project, current_user).execute
+ end
+
def assign_endpoint_vars
@boards_endpoint = project_boards_path(project)
@bulk_issues_path = bulk_update_project_issues_path(project)