FIX: ensure the group 'everyone' is never shown when using a different locale

This commit is contained in:
Régis Hanol
2016-10-24 10:53:31 +02:00
parent dc0d302345
commit 81e2a0099f
3 changed files with 8 additions and 12 deletions

View File

@ -1,10 +1,9 @@
class Admin::GroupsController < Admin::AdminController
def index
groups = Group.order(:name).where("name <> 'everyone'")
groups = Group.order(:name).where("id <> ?", Group::AUTO_GROUPS[:everyone])
if search = params[:search]
search = search.to_s
if search = params[:search].to_s
groups = groups.where("name ILIKE ?", "%#{search}%")
end