Sha256: 126081bb1a0cbb19c8bc08a61cd86bb70ca66a66b66eee2caf634188cf9f2c20

Contents?: true

Size: 713 Bytes

Versions: 53

Compression:

Stored size: 713 Bytes

Contents

# <%= autogenerated_model_warning %>

class Group < ApplicationRecord
  include CanvasSync::Record
  include CanvasSync::Concerns::ApiSyncable

  canvas_sync_features :defaults

  validates :canvas_id, uniqueness: true, presence: true
  belongs_to :course, primary_key: :canvas_id, foreign_key: :canvas_course_id, optional: true
  belongs_to :account, primary_key: :canvas_id, foreign_key: :canvas_account_id, optional: true
  has_many :group_memberships, primary_key: :canvas_id, foreign_key: :canvas_group_id

  api_syncable({
    canvas_id: :id,
    name: :name,
    canvas_course_id: :course_id,
    sis_id: :sis_group_id,
    workflow_state: ->(r){ 'available' },
  }, -> (api) { api.group(canvas_id) })
end

Version data entries

53 entries across 53 versions & 1 rubygems

Version Path
canvas_sync-0.21.0.beta5 lib/canvas_sync/generators/templates/models/group.rb
canvas_sync-0.21.0.beta4 lib/canvas_sync/generators/templates/models/group.rb
canvas_sync-0.21.0.beta3 lib/canvas_sync/generators/templates/models/group.rb
canvas_sync-0.21.0.beta2 lib/canvas_sync/generators/templates/models/group.rb
canvas_sync-0.21.0.beta1 lib/canvas_sync/generators/templates/models/group.rb
canvas_sync-0.20.5 lib/canvas_sync/generators/templates/models/group.rb
canvas_sync-0.20.4 lib/canvas_sync/generators/templates/models/group.rb
canvas_sync-0.20.3 lib/canvas_sync/generators/templates/models/group.rb
canvas_sync-0.19.1.beta2 lib/canvas_sync/generators/templates/models/group.rb
canvas_sync-0.19.1.beta1 lib/canvas_sync/generators/templates/models/group.rb
canvas_sync-0.19.0 lib/canvas_sync/generators/templates/models/group.rb
canvas_sync-0.19.0.beta10 lib/canvas_sync/generators/templates/models/group.rb
canvas_sync-0.19.0.beta9 lib/canvas_sync/generators/templates/models/group.rb
canvas_sync-0.19.0.beta8 lib/canvas_sync/generators/templates/models/group.rb
canvas_sync-0.19.0.beta7 lib/canvas_sync/generators/templates/models/group.rb
canvas_sync-0.19.0.beta6 lib/canvas_sync/generators/templates/models/group.rb
canvas_sync-0.19.0.beta5 lib/canvas_sync/generators/templates/models/group.rb
canvas_sync-0.19.0.beta4 lib/canvas_sync/generators/templates/models/group.rb
canvas_sync-0.19.0.beta3 lib/canvas_sync/generators/templates/models/group.rb
canvas_sync-0.19.0.beta2 lib/canvas_sync/generators/templates/models/group.rb