Sha256: 56a831b1b5ef0edf7a5245ecb28f604f8e6ecc5285e0918ff1e04091b125a2eb

Contents?: true

Size: 1.43 KB

Versions: 15

Compression:

Stored size: 1.43 KB

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 Rubric < ApplicationRecord
  include CanvasSync::Record
  include CanvasSync::Concerns::ApiSyncable

  canvas_sync_features :defaults

  validates :canvas_id, uniqueness: true, presence: true
  belongs_to :user, primary_key: :canvas_id, foreign_key: :canvas_user_id, optional: true
  belongs_to :rubric, primary_key: :canvas_id, foreign_key: :canvas_rubric_id , optional: true # based on another rubric
  belongs_to :context, polymorphic: true, primary_key: :canvas_id, foreign_key: :canvas_context_id, foreign_type: :canvas_context_type, optional: true

  has_many :rubric_assessments, through: :rubric_associations, dependent: :destroy
  has_many :rubric_associations, primary_key: :canvas_id, foreign_key: :canvas_rubric_id
  has_many :associated_objects, through: :rubric_associations, source: :association_object

  api_syncable({
    canvas_id: :id,
    title: :title,
    canvas_context_id: :context_id,
    canvas_context_type: :context_type,
    points_possible: :points_possible,
    reusable: :reusable,
    read_only: :read_only,
    free_form_criterion_comments: :free_form_criterion_comments,
    hide_score_total: :hide_score_total,
    data: :data,
  }, -> (api) { api.get("api/v1/accounts/#{canvas_root_account_id}/rubrics/#{canvas_id}") })
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
canvas_sync-0.22.6 spec/dummy/app/models/rubric.rb
canvas_sync-0.22.5 spec/dummy/app/models/rubric.rb
canvas_sync-0.22.4 spec/dummy/app/models/rubric.rb
canvas_sync-0.22.3 spec/dummy/app/models/rubric.rb
canvas_sync-0.22.2 spec/dummy/app/models/rubric.rb
canvas_sync-0.22.1 spec/dummy/app/models/rubric.rb
canvas_sync-0.22.0 spec/dummy/app/models/rubric.rb
canvas_sync-0.22.0.beta8 spec/dummy/app/models/rubric.rb
canvas_sync-0.22.0.beta7 spec/dummy/app/models/rubric.rb
canvas_sync-0.22.0.beta6 spec/dummy/app/models/rubric.rb
canvas_sync-0.22.0.beta5 spec/dummy/app/models/rubric.rb
canvas_sync-0.22.0.beta4 spec/dummy/app/models/rubric.rb
canvas_sync-0.22.0.beta3 spec/dummy/app/models/rubric.rb
canvas_sync-0.22.0.beta2 spec/dummy/app/models/rubric.rb
canvas_sync-0.22.0.beta1 spec/dummy/app/models/rubric.rb