Skip to content

Commit

Permalink
Add method to pretty print all course codes for given course [#164]
Browse files Browse the repository at this point in the history
  • Loading branch information
jesjos committed May 8, 2012
1 parent b484745 commit 9847bd6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/models/given_course.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 9847bd6

Please sign in to comment.