Merge branch 'less-sql-queries' into 'master'

Reduce amount of sql queries on dashboard projects page

For https://github.com/gitlabhq/gitlabhq/issues/7218

See merge request !1613
This commit is contained in:
Dmitriy Zaporozhets 2015-03-02 23:30:27 +00:00
commit 3087be1be7
2 changed files with 2 additions and 2 deletions

View file

@ -47,7 +47,7 @@ class DashboardController < ApplicationController
@projects = @projects.where(namespace_id: Group.find_by(name: params[:group])) if params[:group].present?
@projects = @projects.where(visibility_level: params[:visibility_level]) if params[:visibility_level].present?
@projects = @projects.includes(:namespace)
@projects = @projects.includes(:namespace, :forked_from_project, :tags)
@projects = @projects.tagged_with(params[:tag]) if params[:tag].present?
@projects = @projects.sort(@sort = params[:sort])
@projects = @projects.page(params[:page]).per(30)

View file

@ -16,7 +16,7 @@
%li.my-project-row
%h4.project-title
.pull-left
= project_icon("#{project.namespace.to_param}/#{project.to_param}", alt: '', class: 'avatar project-avatar s60')
= project_icon(project, alt: '', class: 'avatar project-avatar s60')
.project-access-icon
= visibility_level_icon(project.visibility_level)
= link_to project_path(project), class: dom_class(project) do