Skip to content

fix: missing fall 2026 term in schedule dropdown#503

Merged
jaspermayone merged 1 commit into
mainfrom
jaspermayone/502-term-season-order
Jul 11, 2026
Merged

fix: missing fall 2026 term in schedule dropdown#503
jaspermayone merged 1 commit into
mainfrom
jaspermayone/502-term-season-order

Conversation

@jaspermayone

Copy link
Copy Markdown
Member

Fixes #502

Root cause

The season enum stores non-chronological values (spring: 1, fall: 2, summer: 3), and Term.current_and_future compared seasons by raw enum value:

where("(year > ?) OR (year = ? AND season >= ?)", ...)

During a summer term (season value 3), fall of the same year (season value 2) fails the >= 3 check — so the Fall option disappears from the schedule dropdown every summer. The same raw values were used in order(season: ...) calls, sorting Fall before Summer within a year across the app.

Changes

  • Added Term::SEASON_CHRONOLOGICAL_POSITIONS and a season_position_sql CASE expression that maps stored enum values to chronological order (spring → summer → fall). No data migration needed.
  • New chronological / reverse_chronological scopes; replaced all raw order(year:, season:) usages (term scopes, admin terms/course catalog/finals schedules/rooms).
  • current_and_future now compares by chronological position, so Fall 2026 shows during Summer 2026.
  • The schedule page now only offers terms the user has enrollments in (new Term.enrolled_for(user) scope), and the selected term is resolved from that list rather than any term_uid param.
flowchart LR
    A[Term.enrolled_for user] --> B[current_and_future]
    B -->|empty| C[last 6 enrolled terms]
    B -->|present| D[term dropdown]
    C --> D
Loading

Tests

Model specs for the chronological scopes, current_and_future in both summer and fall, enrolled_for, and season_position. Full suite passes locally.

@jaspermayone
jaspermayone merged commit 4076b42 into main Jul 11, 2026
1 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

missing fall 2026 option in schedule

1 participant