Files
project-work/worker-toolkit-stocks-in-the-future/repo/db/seeds/partials/grades.rb
Eric Bell 392781f7aa chore: init commit
in worker.../repo/GITFOLDER.zip is the .git folder.
2026-08-11 14:44:09 -04:00

14 lines
416 B
Ruby

# Create grade levels 5-8
Classroom::GRADE_RANGE.each do |level|
# Create the grade name with proper ordinal (5th, 6th, 7th, etc.)
grade_name = "#{level.ordinalize} Grade"
grade = Grade.find_or_create_by(level: level) do |g|
g.name = grade_name
end
# Update name if it's not following the convention
if grade.persisted? && grade.name != grade_name
grade.update!(name: grade_name)
end
end