refactor authentication method

pull/1/head
rebuilt 3 years ago
parent 7d387dbe0e
commit 308742f619

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

Loading…
Cancel
Save