fix userlist sorting; fix idiot-check

This commit is contained in:
jomo
2014-06-29 06:36:55 +02:00
parent 018866d209
commit ed2feab298
2 changed files with 3 additions and 4 deletions

View File

@@ -11,10 +11,9 @@ class UsersController < ApplicationController
@users = User.where(role: Role.get(params[:role]))
end
else
@users = User.all.to_a
@users.shift #Remove first user
@users = User.where.not(id: User.first.id) #Remove first user
end
@users = @users.to_a.sort_by{|u| u.role}.reverse!
@users = @users.order("role_id desc", :name).to_a
end
def show