Sha256: 7c3eedf4172086a0fae538a39b2ffb7f8fb74e4bcc39d6a85c8d180dbbddca5e

Contents?: true

Size: 797 Bytes

Versions: 8

Compression:

Stored size: 797 Bytes

Contents

module CoalescingPanda
  class Course < ActiveRecord::Base
    belongs_to :account, foreign_key: :coalescing_panda_lti_account_id, class_name: 'CoalescingPanda::LtiAccount'
    belongs_to :term, foreign_key: :coalescing_panda_term_id, class_name: 'CoalescingPanda::Term'
    has_many :sections, foreign_key: :coalescing_panda_course_id, class_name: 'CoalescingPanda::Section'
    has_many :enrollments, through: :sections
    has_many :assignments, foreign_key: :coalescing_panda_course_id, class_name: 'CoalescingPanda::Assignment'
    has_many :submissions, through: :assignments
    has_many :users, through: :sections, source: :users, class_name: 'CoalescingPanda::User'

    validates :coalescing_panda_lti_account_id, presence: true
    validates :canvas_course_id, presence: true
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
coalescing_panda-3.1.13 app/models/coalescing_panda/course.rb
coalescing_panda-3.1.12 app/models/coalescing_panda/course.rb
coalescing_panda-3.1.11 app/models/coalescing_panda/course.rb
coalescing_panda-3.1.10 app/models/coalescing_panda/course.rb
coalescing_panda-3.1.9 app/models/coalescing_panda/course.rb
coalescing_panda-3.1.8 app/models/coalescing_panda/course.rb
coalescing_panda-3.1.7 app/models/coalescing_panda/course.rb
coalescing_panda-3.1.6 app/models/coalescing_panda/course.rb