summaryrefslogtreecommitdiff
path: root/app/controllers
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-03-30 06:07:59 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-30 06:07:59 +0000
commit7421e6f9f2b5889b05738af7eba568af6ae3fcbc (patch)
tree0c7f9656565ae4ef09611345248ea518c4deb5b8 /app/controllers
parentbf32dbaad2b059a3bf3e880c08cb0a026effc158 (diff)
downloadgitlab-ce-7421e6f9f2b5889b05738af7eba568af6ae3fcbc.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/boards/issues_controller.rb15
1 files changed, 10 insertions, 5 deletions
diff --git a/app/controllers/boards/issues_controller.rb b/app/controllers/boards/issues_controller.rb
index 5e14339bb07..ccb9dd7bbf6 100644
--- a/app/controllers/boards/issues_controller.rb
+++ b/app/controllers/boards/issues_controller.rb
@@ -24,17 +24,14 @@ module Boards
push_frontend_feature_flag(:board_search_optimization, board.group)
end
- # rubocop: disable CodeReuse/ActiveRecord
def index
list_service = Boards::Issues::ListService.new(board_parent, current_user, filter_params)
- issues = list_service.execute
- issues = issues.page(params[:page]).per(params[:per] || 20).without_count
+ issues = issues_from(list_service)
+
Issue.move_nulls_to_end(issues) if Gitlab::Database.read_write?
- issues = issues.preload(associations_to_preload)
render_issues(issues, list_service.metadata)
end
- # rubocop: enable CodeReuse/ActiveRecord
def create
service = Boards::Issues::CreateService.new(board_parent, project, current_user, issue_params)
@@ -67,6 +64,14 @@ module Boards
private
+ def issues_from(list_service)
+ issues = list_service.execute
+ issues.page(params[:page]).per(params[:per] || 20)
+ .without_count
+ .preload(associations_to_preload) # rubocop: disable CodeReuse/ActiveRecord
+ .load
+ end
+
def associations_to_preload
[
:milestone,