From 2cb966e1240420feb007b953b9b1c63842406100 Mon Sep 17 00:00:00 2001 From: Jared Cosulich Date: Wed, 24 Jul 2019 20:32:47 -0400 Subject: [PATCH] default to the last year --- app/controllers/categories_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/categories_controller.rb b/app/controllers/categories_controller.rb index f9ae4d86..f979a5cc 100644 --- a/app/controllers/categories_controller.rb +++ b/app/controllers/categories_controller.rb @@ -16,7 +16,7 @@ class CategoriesController < ApplicationController school_categories = SchoolCategory.for(@school, @category) @years = school_categories.map(&:year).map(&:to_i).sort - @year = (params[:year] || @years.first || "2019").to_i + @year = (params[:year] || @years.last || "2019").to_i @years.delete(@year) if school_categories.empty?