diff options
author | Mehdi Lahmam <mehdi@lahmam.com> | 2017-08-11 11:09:07 +0200 |
---|---|---|
committer | Mehdi Lahmam <mehdi@lahmam.com> | 2017-08-24 10:11:00 +0200 |
commit | d184f27ed387c1a90a9f06f68eab801ec3bd89e3 (patch) | |
tree | 740d09a879e551ae613c22e31604bc48c2b3b7bb /app/controllers/admin | |
parent | 99bb3dde251d127fb897eb01fcade7c7f3d8c063 (diff) | |
download | gitlab-ce-d184f27ed387c1a90a9f06f68eab801ec3bd89e3.tar.gz |
Refactor Admin::ProjectsFinder by extracting finders as private methods
Diffstat (limited to 'app/controllers/admin')
-rw-r--r-- | app/controllers/admin/projects_controller.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/controllers/admin/projects_controller.rb b/app/controllers/admin/projects_controller.rb index 0b6cd71e651..50cf2643390 100644 --- a/app/controllers/admin/projects_controller.rb +++ b/app/controllers/admin/projects_controller.rb @@ -3,9 +3,9 @@ class Admin::ProjectsController < Admin::ApplicationController before_action :group, only: [:show, :transfer] def index - finder = Admin::ProjectsFinder.new(params: params, current_user: current_user) - @projects = finder.execute - @sort = finder.sort + params[:sort] ||= 'latest_activity_desc' + @sort = params[:sort] + @projects = Admin::ProjectsFinder.new(params: params, current_user: current_user).execute respond_to do |format| format.html |