You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This plan supports IDEA-360 (Unclaimed Student — Decouple Student from User Account), the foundational prerequisite for the Student File Importer (IDEA-351) and College Driven Registration. The goal is to make the Student-User association optional, introduce the claim_state model, and ensure all existing platform features work correctly when a student has no user account.
Key constraints:
Email and contact information are genuinely optional for unclaimed students
Phase 1 is infrastructure only — no creation paths ship in this release
Student Accounts page redesign is handled separately by Product
Per-college local option gates the feature
Unclaimed students will always have a CSA (since they're always associated with a college)
Reports will show blank fields for user-sourced data (email, login, cell_phone) — accepted behavior
Set claim_state = 'claimed' where user_id IS NOT NULL AND user confirmed_at IS NOT NULL
Backfill invitation_pending
Set claim_state = 'invitation_pending' where user_id IS NOT NULL AND user confirmed_at IS NULL
belongs_to :user
Add optional: true (user_id is already nullable in DB)
Safe Accessor Pattern (app/models/student.rb)
Replace delegate(:cell_phone, :cell_phone=, :email, :email=, :login, to: :user) (line 60) with safe methods. The delegate is removed only on student.rb — the CSA→student delegation (CSA line 54) stays in place and chains through our safe accessors.
For claimed students, user&.email returns the user's email (identical to current behavior). For unclaimed students, it falls through to the student's own column (or nil if absent).
Delegation chain: csa.email → student.email (CSA delegation stays) → safe accessor → works for both claimed and unclaimed.
cell_phone storage gap: The students table has an email column but NO cell_phone column. Currently cell_phone only exists on the users table. The CSA table has phone (a different field) but not cell_phone. With the safe accessor, student.cell_phone for unclaimed students returns user&.cell_phone (nil) || read_attribute(:cell_phone) (nil — no column). If we ever need to store cell_phone for unclaimed students, we'll need to add the column. (See follow-up question #1.)
Guard before_create callback (lines 50-54)
Currently assumes user is present (self.user.email, self.user.name, self.user.roles). Wrap in if self.user.present?.
Guard destroy: if no user, destroy student directly
background_student_batch_action.rb
Guard student.user before destroy
background_send_student_reminders.rb
Filter unclaimed students from query
2i. Other Models
File
Fix
form.rb (lines 52, 134, 217)
Conditionally add user to liquid_params
csub_application_api.rb (line 66)
student.user&.email || ''
3. College-Managed Registrations (Context)
The existing registration infrastructure supports unclaimed students:
CreateCourseRegistrationForm validates student_id + course_section_id, does NOT require user. Requires a completed CSA.
CreateStudentDeCourseRegistrationService creates StudentDeCourse, triggers active_flows. No user dependency.
All SIS integrations use student_number from CSA — verified across 65+ steps.
Unclaimed students will always have a CSA since they're always created in the context of a college.
4. Follow-Up Questions
Resolved
Question
Resolution
Claim state model
claim_state enum (unclaimed/invitation_pending/claimed) per IDEA-360
Future upgrade path
Modeled in claim_state transitions
SIS student_number
IDEA-361 Connection Records + Entity Resolution
Student Accounts page
Product redesigning separately
Admin "View As"
Not possible — hide button
Unclaimed student visibility
IDEA-359 planned
CSA creation
Unclaimed students will always have a CSA
Reports blank fields
Accepted — show blanks
Parent/Approver workflows
Unaffected — SAP belongs_to parent's own user, not student's user
Scanned signatures
Not supported for unclaimed students — guard with comment
Backfill unconfirmed users
invitation_pending (not claimed)
Still Open — Needs Input
cell_phone column on students table: The cell_phone column only exists on the users table. The students table has email but not cell_phone. The CSA has phone (different field) but not cell_phone. With the safe accessor, student.cell_phone returns nil for unclaimed students since there's no column to fall through to. The CSA delegation chain (csa.cell_phone → student.cell_phone → user.cell_phone) also returns nil. The CSA's get_any_value('cell_phone') can check application_field_values as an alternative source. Do we need to add a cell_phone column to the students table (mirroring how email already works)?
Student merge across claim states: If an unclaimed student is merged with a claimed student, does the merged student keep the user account? Any restrictions?
5. Testing / QA Plan
Setup
Create via console or scripts on the Review App:
Unclaimed student (claim_state: 'unclaimed', no user, email may or may not be present)
CollegeStudentApplication for the unclaimed student (with student_number, demographics)