Sha256: ff0b581098c9223f978a7859378e9207ec4948052568e578a6256826856c0883

Contents?: true

Size: 864 Bytes

Versions: 82

Compression:

Stored size: 864 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

  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

82 entries across 82 versions & 1 rubygems

Version Path
canvas_sync-0.17.23 lib/canvas_sync/generators/templates/models/context_module.rb
canvas_sync-0.17.23.beta8 lib/canvas_sync/generators/templates/models/context_module.rb
canvas_sync-0.17.23.beta7 lib/canvas_sync/generators/templates/models/context_module.rb
canvas_sync-0.17.23.beta6 lib/canvas_sync/generators/templates/models/context_module.rb
canvas_sync-0.17.23.beta5 lib/canvas_sync/generators/templates/models/context_module.rb
canvas_sync-0.17.23.beta4 lib/canvas_sync/generators/templates/models/context_module.rb
canvas_sync-0.17.23.beta2 lib/canvas_sync/generators/templates/models/context_module.rb
canvas_sync-0.17.23.beta1 lib/canvas_sync/generators/templates/models/context_module.rb
canvas_sync-0.17.20 lib/canvas_sync/generators/templates/models/context_module.rb
canvas_sync-0.17.19 lib/canvas_sync/generators/templates/models/context_module.rb
canvas_sync-0.17.18 lib/canvas_sync/generators/templates/models/context_module.rb
canvas_sync-0.17.17.beta1 lib/canvas_sync/generators/templates/models/context_module.rb
canvas_sync-0.17.16 lib/canvas_sync/generators/templates/models/context_module.rb
canvas_sync-0.17.15 lib/canvas_sync/generators/templates/models/context_module.rb
canvas_sync-0.17.14 lib/canvas_sync/generators/templates/models/context_module.rb
canvas_sync-0.17.13 lib/canvas_sync/generators/templates/models/context_module.rb
canvas_sync-0.17.12 lib/canvas_sync/generators/templates/models/context_module.rb
canvas_sync-0.17.10.beta2 lib/canvas_sync/generators/templates/models/context_module.rb
canvas_sync-0.17.10.beta1 lib/canvas_sync/generators/templates/models/context_module.rb
canvas_sync-0.17.8 lib/canvas_sync/generators/templates/models/context_module.rb