PERF: Remove eager load.
This commit is contained in:
parent
fbc3fcc4af
commit
712ff01f38
|
@ -1,9 +1,7 @@
|
|||
class Admin::GroupsController < Admin::AdminController
|
||||
|
||||
def index
|
||||
groups = Group.order(:name)
|
||||
.where("id <> ?", Group::AUTO_GROUPS[:everyone])
|
||||
.includes(:group_users)
|
||||
groups = Group.order(:name).where("id <> ?", Group::AUTO_GROUPS[:everyone])
|
||||
|
||||
if search = params[:search].to_s
|
||||
groups = groups.where("name ILIKE ?", "%#{search}%")
|
||||
|
|
Loading…
Reference in New Issue