Any time you get a name error like this, it’s usually the result of either a typo or accidentally using a variable that is not defined. This particular error tells you exactly where to look, so it’s super important to always examine the error message. Check the variable course in the enroll method on line 20 of student.rb.
Oh, I think I see what I did now. This whole time I thought course.students << self was accessing course class and adding self into students array but it doesn’t work like that. I’m supposed to add the new_course I’ve defined into students. I realize that now I’ve changed the method to this:
def enroll(new_course)
@courses << new_course
new_course.students << self
end
and it passes the specs it wasn’t passing before. Thank you!!!