hrmm, instead of trying to set the hash all at once, why not just split up the lines (so you can avoid the ternary operator), unless you need the keys underneath of course, which you can initially seed in the initial hash as well.
``
data[:gpa_units] = {}
data[:gpa_units][:cumulative_gpa] = student_info["cum_gpa"] if student_info["cum_gpa"]
...
``