diff options
author | Dmitriy Zaporozhets <dzaporozhets@gitlab.com> | 2015-03-02 23:30:27 +0000 |
---|---|---|
committer | Dmitriy Zaporozhets <dzaporozhets@gitlab.com> | 2015-03-02 23:30:27 +0000 |
commit | 3087be1be70c1cbef565f21b418b4d9f8781b2fc (patch) | |
tree | e7c80c419bc856d1168e5018cb7fd509318c53fa /app | |
parent | 33e107127a4c37cefaf24c0f5dd335e782594da3 (diff) | |
parent | 643afcbe00b766f786e6c7bac6cbd55870159df1 (diff) | |
download | gitlab-ce-3087be1be70c1cbef565f21b418b4d9f8781b2fc.tar.gz |
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
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/dashboard_controller.rb | 2 | ||||
-rw-r--r-- | app/views/dashboard/projects.html.haml | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/app/controllers/dashboard_controller.rb b/app/controllers/dashboard_controller.rb index eca7b39bcdf..4930029e165 100644 --- a/app/controllers/dashboard_controller.rb +++ b/app/controllers/dashboard_controller.rb @@ -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) diff --git a/app/views/dashboard/projects.html.haml b/app/views/dashboard/projects.html.haml index 15db8592547..03d4b3d8bbb 100644 --- a/app/views/dashboard/projects.html.haml +++ b/app/views/dashboard/projects.html.haml @@ -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 |