Sha256: 5c205ae2eca8ab8638363c05a870e57d015b937d2d167f686808acb1e5d57c23

Contents?: true

Size: 880 Bytes

Versions: 78

Compression:

Stored size: 880 Bytes

Contents

# <%= autogenerated_model_warning %>

class Submission < ApplicationRecord
  include CanvasSync::Record
  include CanvasSync::Concerns::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,
    cached_due_date: :due_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

78 entries across 78 versions & 1 rubygems

Version Path
canvas_sync-0.17.43 lib/canvas_sync/generators/templates/models/submission.rb
canvas_sync-0.17.42 lib/canvas_sync/generators/templates/models/submission.rb
canvas_sync-0.17.41 lib/canvas_sync/generators/templates/models/submission.rb
canvas_sync-0.17.40 lib/canvas_sync/generators/templates/models/submission.rb
canvas_sync-0.17.39 lib/canvas_sync/generators/templates/models/submission.rb
canvas_sync-0.17.38 lib/canvas_sync/generators/templates/models/submission.rb
canvas_sync-0.17.37 lib/canvas_sync/generators/templates/models/submission.rb
canvas_sync-0.17.36 lib/canvas_sync/generators/templates/models/submission.rb
canvas_sync-0.17.35 lib/canvas_sync/generators/templates/models/submission.rb
canvas_sync-0.17.34 lib/canvas_sync/generators/templates/models/submission.rb
canvas_sync-0.17.33 lib/canvas_sync/generators/templates/models/submission.rb
canvas_sync-0.17.32 lib/canvas_sync/generators/templates/models/submission.rb
canvas_sync-0.17.31 lib/canvas_sync/generators/templates/models/submission.rb
canvas_sync-0.17.30 lib/canvas_sync/generators/templates/models/submission.rb
canvas_sync-0.17.29 lib/canvas_sync/generators/templates/models/submission.rb
canvas_sync-0.17.28 lib/canvas_sync/generators/templates/models/submission.rb
canvas_sync-0.17.27 lib/canvas_sync/generators/templates/models/submission.rb
canvas_sync-0.17.27.beta1 lib/canvas_sync/generators/templates/models/submission.rb
canvas_sync-0.17.26.beta1 lib/canvas_sync/generators/templates/models/submission.rb
canvas_sync-0.17.24 lib/canvas_sync/generators/templates/models/submission.rb