refactor authentication method

This commit is contained in:
rebuilt 2023-03-21 13:37:50 -07:00
parent 7d387dbe0e
commit 308742f619

View file

@ -10,8 +10,11 @@ class SqmApplicationController < ApplicationController
private
def authenticate_district
name = @district.name.split(" ").first.downcase
authenticate(name, "#{name}!")
authenticate(district_name, "#{district_name}!")
end
def district_name
@district_name ||= @district.name.split(" ").first.downcase
end
def set_schools_and_districts