module Sis module Core class CourseRegistration < ApplicationRecord belongs_to :course_offering belongs_to :student belongs_to :section delegate(:course_code, to: :course_offering, prefix: false) delegate(:course_title, to: :course_offering, prefix: false) delegate(:course_ects, to: :course_offering, prefix: false) delegate(:course_credit_hours, to: :course_offering, prefix: false) delegate(:first_name, to: :student, prefix: true) delegate(:middle_name, to: :student, prefix: true) delegate(:last_name, to: :student, prefix: true) delegate(:student_id, to: :student, prefix: true) delegate(:name, to: :section, prefix: true) delegate(:programme_level_id, to: :student, prefix: true) end end end