summaryrefslogtreecommitdiff
path: root/app/controllers/admin/projects_controller.rb
diff options
context:
space:
mode:
authorMaxim Rydkin <maks.rydkin@gmail.com>2017-07-24 10:54:16 +0000
committerRémy Coutable <remy@rymai.me>2017-07-24 10:54:16 +0000
commitfab1b0f1d189094ade6be5c35f03a53eeff99872 (patch)
tree0fd0e43232447b1915227088fe4152753bae93f1 /app/controllers/admin/projects_controller.rb
parent56977be31ad37945863a08169bc72c679a294ea0 (diff)
downloadgitlab-ce-fab1b0f1d189094ade6be5c35f03a53eeff99872.tar.gz
Decrease ABC threshold to 56.96
Diffstat (limited to 'app/controllers/admin/projects_controller.rb')
-rw-r--r--app/controllers/admin/projects_controller.rb15
1 files changed, 3 insertions, 12 deletions
diff --git a/app/controllers/admin/projects_controller.rb b/app/controllers/admin/projects_controller.rb
index 984d5398708..0b6cd71e651 100644
--- a/app/controllers/admin/projects_controller.rb
+++ b/app/controllers/admin/projects_controller.rb
@@ -3,18 +3,9 @@ class Admin::ProjectsController < Admin::ApplicationController
before_action :group, only: [:show, :transfer]
def index
- params[:sort] ||= 'latest_activity_desc'
- @projects = Project.with_statistics
- @projects = @projects.in_namespace(params[:namespace_id]) if params[:namespace_id].present?
- @projects = @projects.where(visibility_level: params[:visibility_level]) if params[:visibility_level].present?
- @projects = @projects.with_push if params[:with_push].present?
- @projects = @projects.abandoned if params[:abandoned].present?
- @projects = @projects.where(last_repository_check_failed: true) if params[:last_repository_check_failed].present?
- @projects = @projects.non_archived unless params[:archived].present?
- @projects = @projects.personal(current_user) if params[:personal].present?
- @projects = @projects.search(params[:name]) if params[:name].present?
- @projects = @projects.sort(@sort = params[:sort])
- @projects = @projects.includes(:namespace).order("namespaces.path, projects.name ASC").page(params[:page])
+ finder = Admin::ProjectsFinder.new(params: params, current_user: current_user)
+ @projects = finder.execute
+ @sort = finder.sort
respond_to do |format|
format.html