Sha256: 50eebc57d608ffef7595b90ca3bea4be16702251ce8fc1fc66bdedadac4f415e

Contents?: true

Size: 623 Bytes

Versions: 1

Compression:

Stored size: 623 Bytes

Contents

<%= autogenerated_model_warning %>

class AssignmentGroup < ApplicationRecord
  include CanvasSync::ApiSyncable

  validates :canvas_id, uniqueness: true, presence: true
  belongs_to :course, primary_key: :canvas_id, foreign_key: :canvas_course_id, optional: true
  has_many :assignments, primary_key: :canvas_id, foreign_key: :canvas_assignment_group_id

  serialize :rules

  api_syncable({
    canvas_id: :id,
    name: :name,
    position: :position,
    rules: :rules,
    group_weight: :group_weight,
    workflow_state: ->(p) { 'available' },
  }, -> (api) { api.assignment_group(canvas_course_id, canvas_id) })
end

Version data entries

1 entries across 1 versions & 1 rubygems

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