Sha256: b0fbc23523254ff4728bb23dd6c1c611e901eafb8761044887bffd49fa1ab480

Contents?: true

Size: 604 Bytes

Versions: 2

Compression:

Stored size: 604 Bytes

Contents

<%= autogenerated_migration_warning %>

# A ContextModule is the same as a Canvas Module. They're called ContextModules for 2 reasons:
#   1 - Module is a reserved word in Rails and you can't call a model a Module
#   2 - Canvas calls them ContextModules
class ContextModule < ApplicationRecord
  belongs_to :context, polymorphic: true, optional: true, primary_key: :canvas_id, foreign_key: :canvas_context_id, foreign_type: :canvas_context_type
  has_many :context_module_items, primary_key: :canvas_id, foreign_key: :canvas_context_module_id
  has_many :assignments, through: :context_module_items
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
canvas_sync-0.10.2 lib/canvas_sync/generators/templates/models/context_module.rb
canvas_sync-0.10.0 lib/canvas_sync/generators/templates/models/context_module.rb