Commit a1b9b1d8 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Use rails preload for Dashboard issues, mr

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 2171bbcd
......@@ -55,12 +55,13 @@ class DashboardController < ApplicationController
def merge_requests
@merge_requests = FilteringService.new.execute(MergeRequest, current_user, params)
@merge_requests = @merge_requests.page(params[:page]).per(20)
@merge_requests = @merge_requests.preload(:author, :project)
end
def issues
@issues = FilteringService.new.execute(Issue, current_user, params)
@issues = @issues.page(params[:page]).per(20)
@issues = @issues.includes(:author, :project)
@issues = @issues.preload(:author, :project)
respond_to do |format|
format.html
......
......@@ -49,12 +49,13 @@ class GroupsController < ApplicationController
def merge_requests
@merge_requests = FilteringService.new.execute(MergeRequest, current_user, params)
@merge_requests = @merge_requests.page(params[:page]).per(20)
@merge_requests = @merge_requests.preload(:author, :project)
end
def issues
@issues = FilteringService.new.execute(Issue, current_user, params)
@issues = @issues.page(params[:page]).per(20)
@issues = @issues.includes(:author, :project)
@issues = @issues.preload(:author, :project)
respond_to do |format|
format.html
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment