From 243ec39b5d29cf08fb1def75842bd556a4b22355 Mon Sep 17 00:00:00 2001 From: Nelson Jovel Date: Fri, 10 Dec 2021 15:17:02 +0100 Subject: [PATCH] Sort schools alphabetically. Finishes #180280546 --- app/controllers/home_controller.rb | 2 +- app/controllers/sqm_application_controller.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index e1e72c3e..a1966c25 100644 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -1,7 +1,7 @@ class HomeController < ApplicationController def index @districts = District.all.order(:name) - @schools = School.all + @schools = School.all.order(:name) @categories = Category.sorted.map { |category| CategoryPresenter.new(category: category) } end diff --git a/app/controllers/sqm_application_controller.rb b/app/controllers/sqm_application_controller.rb index 863829c8..fc6d983f 100644 --- a/app/controllers/sqm_application_controller.rb +++ b/app/controllers/sqm_application_controller.rb @@ -11,9 +11,9 @@ class SqmApplicationController < ApplicationController def set_schools_and_districts @district = District.find_by_slug district_slug - @districts = District.all.sort_by(&:name) + @districts = District.all.order(:name) @school = School.find_by_slug school_slug - @schools = School.where(district: @district).sort_by(&:name) + @schools = School.where(district: @district).order(:name) @academic_year = AcademicYear.find_by_range params[:year] @has_empty_dataset = Measure.none_meet_threshold? school: @school, academic_year: @academic_year end