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]}"