Skip to content

Commit

Permalink
add check for surname
Browse files Browse the repository at this point in the history
  • Loading branch information
amtuannguyen committed Sep 3, 2024
1 parent 8210b01 commit f4d7ae9
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/tasks/load_gem_records_csv.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ def load_gem_records(filename)
gr = GemRecord.new
end
gr.seqgradevent = seqgradevent
#gr.studentname = row['studentname'].strip unless row['studentname'].nil?
gr.sisid = row['sisid'].strip unless row['sisid'].nil?
gr.emailaddress = row['emailaddress'].strip unless row['emailaddress'].nil?
gr.eventtype = row['eventtype'].strip unless row['eventtype'].nil?
Expand All @@ -26,8 +25,7 @@ def load_gem_records(filename)
gr.program = row['program'].strip unless row['program'].nil?
gr.superv = row['superv'].strip unless row['superv'].nil?
gr.examdate = row['examdate'].strip unless row['examdate'].nil?

gr.studentname = row['surname'].strip + ', ' + row['firstname'].strip + ' ' + row['middlename'].strip
gr.studentname = row['surname'].strip + ', ' + row['firstname'].strip + ' ' + row['middlename'].strip unless row['surname'].nil?

# save without validation as GEM records may have incomplete data
gr.save!(validate: false)
Expand Down

0 comments on commit f4d7ae9

Please sign in to comment.