diff --git a/app/models/given_course.rb b/app/models/given_course.rb index 96d5bb42..d20768b3 100644 --- a/app/models/given_course.rb +++ b/app/models/given_course.rb @@ -18,4 +18,9 @@ class GivenCourse < ActiveRecord::Base def register_student(student) StudentRegisteredForCourse.create!(student: student, given_course: self) end + + # @return String: All the course codes associated with the course + def all_course_codes + self.course.course_codes.map{|c| c.code}.join(" | ") + end end