Sha256: 4b09323cb4a1d2b7f8d7f22bdbf954536e0331a03c45c7289044350c50cc2716

Contents?: true

Size: 846 Bytes

Versions: 4

Compression:

Stored size: 846 Bytes

Contents

module Sis
  module Core
    class Student < ApplicationRecord
      has_one_attached :picture
      belongs_to :user
      belongs_to :level, optional: true
      belongs_to :semester, optional: true
      belongs_to :entry, optional: true
      belongs_to :programme
      belongs_to :programme_level
      belongs_to :programme_type
      belongs_to :advisor, class_name: 'Sis::Core::Instructor', optional: true
      has_many :course_registrations

      delegate(:first_name, to: :user, prefix: false)
      delegate(:last_name, to: :user, prefix: false)
      delegate(:email, to: :user, prefix: false)
      delegate(:first_name, to: :advisor, prefix: true, allow_nil: true)
      delegate(:middle_name, to: :advisor, prefix: true, allow_nil: true)
      delegate(:last_name, to: :advisor, prefix: true, allow_nil: true)
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

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