diff options
author | Chantal Rollison <crollison@gitlab.com> | 2018-09-10 20:26:33 +0300 |
---|---|---|
committer | Chantal Rollison <crollison@gitlab.com> | 2018-10-19 04:43:50 +0300 |
commit | c871faa3e42edf7c1d92669cf18a5b0de7c84ace (patch) | |
tree | 2444e8fa9d9233ff245e93076b610a47022146b9 /app/controllers/boards | |
parent | a88004c876b94d44ce61c19d8c4c42e8de636f58 (diff) |
Add preload in issues controller
Diffstat (limited to 'app/controllers/boards')
-rw-r--r-- | app/controllers/boards/issues_controller.rb | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/app/controllers/boards/issues_controller.rb b/app/controllers/boards/issues_controller.rb index 4f3d737e3ce..7f874687212 100644 --- a/app/controllers/boards/issues_controller.rb +++ b/app/controllers/boards/issues_controller.rb @@ -18,10 +18,15 @@ module Boards 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 - make_sure_position_is_set(issues) if Gitlab::Database.read_write? - issues = issues.preload(:project, - :milestone, + Issue.move_to_end(issues) if Gitlab::Database.read_write? + issues = issues.preload(:milestone, :assignees, + project: [ + :route, + { + namespace: [:route] + } + ], labels: [:priorities], notes: [:award_emoji, :author] ) @@ -60,12 +65,6 @@ module Boards render json: data end - def make_sure_position_is_set(issues) - issues.each do |issue| - issue.move_to_end && issue.save unless issue.relative_position - end - end - def issue @issue ||= issues_finder.find(params[:id]) end |