Sha256: 11f60398a555ee2c9e520b2b0e475122fc1f460f2d7ce05270121bcda73c087f

Contents?: true

Size: 642 Bytes

Versions: 6

Compression:

Stored size: 642 Bytes

Contents

<%= autogenerated_model_warning %>

class AssignmentGroup < ApplicationRecord
  include CanvasSync::ApiSyncable

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

  serialize :rules

  api_syncable({
    canvas_assignment_group_id: :id,
    name: :name,
    position: :position,
    rules: :rules,
    group_weight: :group_weight,
  }, -> (api) { api.assignment(course_id, canvas_assignment_group_id) })
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
canvas_sync-0.9.4 lib/canvas_sync/generators/templates/models/assignment_group.rb
canvas_sync-0.9.3 lib/canvas_sync/generators/templates/models/assignment_group.rb
canvas_sync-0.9.2 lib/canvas_sync/generators/templates/models/assignment_group.rb
canvas_sync-0.9.1 lib/canvas_sync/generators/templates/models/assignment_group.rb
canvas_sync-0.9.0 lib/canvas_sync/generators/templates/models/assignment_group.rb
canvas_sync-0.8.4 lib/canvas_sync/generators/templates/models/assignment_group.rb