chore: seed enrollment

This commit is contained in:
Nelson Jovel 2024-01-12 21:04:42 -08:00
parent bd8dfe45d3
commit 0af7d42e52
9 changed files with 97 additions and 53 deletions

View file

@ -1,5 +1,7 @@
module Dashboard
class AcademicYear < ApplicationRecord
scope :by_range, -> { all.map { |ay| [ay.range, ay] }.to_h }
def self.find_by_date(date)
year = parse_year_range(date:)
range = "#{year.start}-#{year.end.to_s[2, 3]}"

View file

@ -10,7 +10,7 @@ module Dashboard
validates :name, presence: true
scope :alphabetic, -> { order(name: :asc) }
scope :school_hash, -> { all.map { |school| [school.dese_id, school] }.to_h }
scope :by_dese_id, -> { all.map { |school| [school.dese_id, school] }.to_h }
def self.find_by_district_code_and_school_code(district_code, school_code)
School