Sha256: b1b3aa0c7e1568505a53bc0fd3deaee30c5c2695a7a2423dd85e53275d1a791a

Contents?: true

Size: 415 Bytes

Versions: 5

Compression:

Stored size: 415 Bytes

Contents

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

Version data entries

5 entries across 5 versions & 1 rubygems

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