Sha256: c6966ce3e0c0566fbb1c3c4acb206b573aba9baffaf95529f55595c40f11442f

Contents?: true

Size: 990 Bytes

Versions: 7

Compression:

Stored size: 990 Bytes

Contents

# # #
# AUTO GENERATED MIGRATION
# This migration was auto generated by the CanvasSync Gem.
# You can add new columns to this table, but removing or
# re-naming ones created here may break Canvas Syncing.
#


# 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::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

7 entries across 7 versions & 1 rubygems

Version Path
canvas_sync-0.11.1 spec/dummy/app/models/context_module.rb
canvas_sync-0.12.0 spec/dummy/app/models/context_module.rb
canvas_sync-0.11.0 spec/dummy/app/models/context_module.rb
canvas_sync-0.10.6 spec/dummy/app/models/context_module.rb
canvas_sync-0.10.5 spec/dummy/app/models/context_module.rb
canvas_sync-0.10.4 spec/dummy/app/models/context_module.rb
canvas_sync-0.10.3 spec/dummy/app/models/context_module.rb