Optimisation on database fetches for the organisations listing
This commit is contained in:
parent
127d043691
commit
389064915f
@ -7,7 +7,7 @@ class OrgasController < ApplicationController
|
|||||||
before_action :authenticate_user!, only: [:validate, :accept]
|
before_action :authenticate_user!, only: [:validate, :accept]
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@search = Orga.moderated.search params[:q]
|
@search = Orga.moderated.includes(:kind).includes(:region).search params[:q]
|
||||||
@search.sorts = 'name' if @search.sorts.empty?
|
@search.sorts = 'name' if @search.sorts.empty?
|
||||||
@orgas = @search.result.page params[:page]
|
@orgas = @search.result.page params[:page]
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user