Sha256: 9bfca738f403aa0cd5e0cb6c7fc2a1bc433893fb0568a7eb461116e83b3d1b0d

Contents?: true

Size: 814 Bytes

Versions: 4

Compression:

Stored size: 814 Bytes

Contents

module Sis
  module Core
    class CurriculumCourse < ApplicationRecord
      belongs_to :curriculum
      belongs_to :course
      validates :course_type, presence: true
      has_many :predecessor_prerequisites, foreign_key: :successor_id, class_name: 'Prerequisite'
      has_many :predecessors, through: :predecessor_prerequisites, source: :predecessor
      has_many :successor_prerequisites, foreign_key: :predecessor_id, class_name: 'Prerequisite'
      has_many :successors, through: :successor_prerequisites, source: :successor

      delegate(:title, to: :course, prefix: true)
      delegate(:code, to: :course, prefix: true)
      delegate(:ects, to: :course, prefix: true)
      delegate(:credit_hours, to: :course, prefix: true)
      delegate(:name, to: :curriculum, prefix: true)
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
sis_core-1.0.19 app/models/sis/core/curriculum_course.rb
sis_core-1.0.18 app/models/sis/core/curriculum_course.rb
sis_core-1.0.17 app/models/sis/core/curriculum_course.rb
sis_core-1.0.16 app/models/sis/core/curriculum_course.rb