summaryrefslogtreecommitdiff
path: root/app/controllers/admin
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-02-05 19:15:05 -0800
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-02-05 19:15:05 -0800
commitbbca6a0abd9f5559fe4abbf2cb2100a0e4717ac8 (patch)
tree34b5f2fd0c2301b8d5284700bec64ee272246bc4 /app/controllers/admin
parente0aa5c371ea1c633a0648f13cd7bea35f3aea75c (diff)
downloadgitlab-ce-bbca6a0abd9f5559fe4abbf2cb2100a0e4717ac8.tar.gz
Refactor sorting in project
Diffstat (limited to 'app/controllers/admin')
-rw-r--r--app/controllers/admin/groups_controller.rb3
-rw-r--r--app/controllers/admin/users_controller.rb4
2 files changed, 4 insertions, 3 deletions
diff --git a/app/controllers/admin/groups_controller.rb b/app/controllers/admin/groups_controller.rb
index ae610d4871c..65dc027c8eb 100644
--- a/app/controllers/admin/groups_controller.rb
+++ b/app/controllers/admin/groups_controller.rb
@@ -2,7 +2,8 @@ class Admin::GroupsController < Admin::ApplicationController
before_filter :group, only: [:edit, :show, :update, :destroy, :project_update, :project_teams_update]
def index
- @groups = Group.order_name
+ @groups = Group.all
+ @groups = @groups.sort(@sort = params[:sort])
@groups = @groups.search(params[:name]) if params[:name].present?
@groups = @groups.page(params[:page]).per(20)
end
diff --git a/app/controllers/admin/users_controller.rb b/app/controllers/admin/users_controller.rb
index 932bfc777e6..e5d15528d78 100644
--- a/app/controllers/admin/users_controller.rb
+++ b/app/controllers/admin/users_controller.rb
@@ -2,10 +2,10 @@ class Admin::UsersController < Admin::ApplicationController
before_filter :user, only: [:show, :edit, :update, :destroy]
def index
- @users = User.filter(params[:filter])
+ @users = User.order_name_asc.filter(params[:filter])
@users = @users.search(params[:name]) if params[:name].present?
@users = @users.sort(@sort = params[:sort])
- @users = @users.order_name.page(params[:page])
+ @users = @users.page(params[:page])
end
def show