Sha256: 80ab4480d54312be832f8d4c2b7c4adb386230b781764fd23649c402843c0f1c

Contents?: true

Size: 1.02 KB

Versions: 4

Compression:

Stored size: 1.02 KB

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'
    has_many :groups, :as => :context, class_name: 'CoalescingPanda::Group'
    has_many :group_memberships, through: :groups, source: :group_memberships, class_name: 'CoalescingPanda::GroupMembership'
    has_many :canvas_batches, as: :context

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

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
coalescing_panda-3.2.3 app/models/coalescing_panda/course.rb
coalescing_panda-3.2.2 app/models/coalescing_panda/course.rb
coalescing_panda-3.2.1 app/models/coalescing_panda/course.rb
coalescing_panda-3.2.0 app/models/coalescing_panda/course.rb