mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-07 21:48:16 -08:00
Add async queries
This commit is contained in:
parent
a6ad132c81
commit
0593f53fb4
4 changed files with 7 additions and 5 deletions
|
|
@ -23,10 +23,10 @@ class OverviewController < SqmApplicationController
|
|||
end
|
||||
|
||||
def measures
|
||||
@measures ||= Measure.all.includes(%i[scales admin_data_items category])
|
||||
@measures ||= Measure.all.includes(%i[scales admin_data_items category]).load_async
|
||||
end
|
||||
|
||||
def subcategories
|
||||
@subcategories ||= Subcategory.all
|
||||
@subcategories ||= Subcategory.all.load_async
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -7,11 +7,11 @@ class SqmApplicationController < ApplicationController
|
|||
|
||||
def set_schools_and_districts
|
||||
@district = District.find_by_slug district_slug
|
||||
@districts = District.all.order(:name)
|
||||
@districts = District.all.order(:name).load_async
|
||||
@school = School.find_by_slug(school_slug)
|
||||
@schools = School.includes([:district]).where(district: @district).order(:name)
|
||||
@schools = School.includes([:district]).where(district: @district).order(:name).load_async
|
||||
@academic_year = AcademicYear.find_by_range params[:year]
|
||||
@academic_years = AcademicYear.all.order(range: :desc)
|
||||
@academic_years = AcademicYear.all.order(range: :desc).load_async
|
||||
end
|
||||
|
||||
def district_slug
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue