Sha256: bf06d75cfba7b774e587199b43f3d9d76d5ca91de7644041db38cbc55172e768

Contents?: true

Size: 946 Bytes

Versions: 20

Compression:

Stored size: 946 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
  include CanvasSync::Record
  include CanvasSync::Concerns::ApiSyncable
  # include CanvasSync::Concerns::LiveEventSync

  canvas_sync_features :defaults

  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

  api_syncable({
    # TODO If your tool Syncs ContextModules, please complete this and merge it into CanvasSync
  }, -> (api) { api.course_module(canvas_context_id, canvas_id) })

end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
canvas_sync-0.22.3 lib/canvas_sync/generators/templates/models/context_module.rb
canvas_sync-0.22.2 lib/canvas_sync/generators/templates/models/context_module.rb
canvas_sync-0.22.1 lib/canvas_sync/generators/templates/models/context_module.rb
canvas_sync-0.22.0 lib/canvas_sync/generators/templates/models/context_module.rb
canvas_sync-0.22.0.beta8 lib/canvas_sync/generators/templates/models/context_module.rb
canvas_sync-0.22.0.beta7 lib/canvas_sync/generators/templates/models/context_module.rb
canvas_sync-0.22.0.beta6 lib/canvas_sync/generators/templates/models/context_module.rb
canvas_sync-0.22.0.beta5 lib/canvas_sync/generators/templates/models/context_module.rb
canvas_sync-0.22.0.beta4 lib/canvas_sync/generators/templates/models/context_module.rb
canvas_sync-0.22.0.beta3 lib/canvas_sync/generators/templates/models/context_module.rb
canvas_sync-0.22.0.beta2 lib/canvas_sync/generators/templates/models/context_module.rb
canvas_sync-0.22.0.beta1 lib/canvas_sync/generators/templates/models/context_module.rb
canvas_sync-0.21.1 lib/canvas_sync/generators/templates/models/context_module.rb
canvas_sync-0.21.1.beta1 lib/canvas_sync/generators/templates/models/context_module.rb
canvas_sync-0.21.0 lib/canvas_sync/generators/templates/models/context_module.rb
canvas_sync-0.21.0.beta5 lib/canvas_sync/generators/templates/models/context_module.rb
canvas_sync-0.21.0.beta4 lib/canvas_sync/generators/templates/models/context_module.rb
canvas_sync-0.21.0.beta3 lib/canvas_sync/generators/templates/models/context_module.rb
canvas_sync-0.21.0.beta2 lib/canvas_sync/generators/templates/models/context_module.rb
canvas_sync-0.21.0.beta1 lib/canvas_sync/generators/templates/models/context_module.rb