The following code needs to be re-written to ensure that a guardian object is always returned even if a cell phone number belongs to both a teacher and a guardian.
if Guardian.valid_number?(phone_number)
guardian = PhoneNumber.find_by_number(phone_number).phone_numberable
check_student_guardian_relationship(guardian, ccsd_id)
The following code needs to be re-written to ensure that a guardian object is always returned even if a cell phone number belongs to both a teacher and a guardian.
if Guardian.valid_number?(phone_number) guardian = PhoneNumber.find_by_number(phone_number).phone_numberable check_student_guardian_relationship(guardian, ccsd_id)