module Sis module Core class Prerequisite < ApplicationRecord belongs_to :predecessor, foreign_key: 'predecessor_id', class_name: 'CurriculumCourse' belongs_to :successor, foreign_key: 'successor_id', class_name: 'CurriculumCourse' def predecessor_name predecessor.course.title.to_s end def successor_name successor.course.name.to_s end end end end