Commit 643afcbe authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Reduce amount of sql queries on dashboard projects page

parent ed3bd155
...@@ -47,7 +47,7 @@ class DashboardController < ApplicationController ...@@ -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(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.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.tagged_with(params[:tag]) if params[:tag].present?
@projects = @projects.sort(@sort = params[:sort]) @projects = @projects.sort(@sort = params[:sort])
@projects = @projects.page(params[:page]).per(30) @projects = @projects.page(params[:page]).per(30)
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
%li.my-project-row %li.my-project-row
%h4.project-title %h4.project-title
.pull-left .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 .project-access-icon
= visibility_level_icon(project.visibility_level) = visibility_level_icon(project.visibility_level)
= link_to project_path(project), class: dom_class(project) do = link_to project_path(project), class: dom_class(project) do
......
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