Sha256: 4a09f9415338bc14f90ec55a973b1c12062203f1705ace14b837783f2466a24b

Contents?: true

Size: 968 Bytes

Versions: 2

Compression:

Stored size: 968 Bytes

Contents

#
# AUTO GENERATED MODEL
# This model was auto generated by the CanvasSync Gem.
# You can customize it as needed, but make sure you test
# any changes you make to the auto generated methods.
#


class Submission < ApplicationRecord
  include CanvasSync::ApiSyncable

  validates :canvas_id, uniqueness: true, presence: true
  belongs_to :assignment, primary_key: :canvas_id, foreign_key: :canvas_assignment_id, optional: true
  belongs_to :user, primary_key: :canvas_id, foreign_key: :canvas_user_id, optional: true
  belongs_to :course, primary_key: :canvas_id, foreign_key: :canvas_course_id, optional: true

  api_syncable({
    canvas_assignment_id: :assignment_id,
    canvas_user_id: :user_id,
    submitted_at: :submitted_at,
    graded_at: :graded_at,
    score: :score,
    excused: :excused,
    workflow_state: :workflow_state,
  }, -> (api) { api.user_course_assignment_submission(assignment.context.canvas_id, canvas_assignment_id, canvas_user_id) })
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
canvas_sync-0.10.2 spec/dummy/app/models/submission.rb
canvas_sync-0.10.0 spec/dummy/app/models/submission.rb