Sha256: dbb0862ceb119705c66ae1ee548ce58578667fb58a021eb70ae7cba673e6ac29

Contents?: true

Size: 1.04 KB

Versions: 6

Compression:

Stored size: 1.04 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 User < ApplicationRecord
  include CanvasSync::Record
  include CanvasSync::Concerns::ApiSyncable

  canvas_sync_features :defaults

  validates :canvas_id, uniqueness: true, presence: true
  has_many :pseudonyms, primary_key: :canvas_id, foreign_key: :canvas_user_id
  has_many :enrollments, primary_key: :canvas_id, foreign_key: :canvas_user_id
  has_many :admins, primary_key: :canvas_id, foreign_key: :canvas_user_id
  has_many :admin_roles, through: :admins, source: :role
  has_many :submissions, primary_key: :canvas_id, foreign_key: :canvas_user_id
  has_many :group_memberships, primary_key: :canvas_id, foreign_key: :canvas_user_id

  api_syncable({
    sis_id: :sis_user_id,
    email: :email,
    login_id: :login_id,
    name: :name,
    sortable_name: :sortable_name,
    first_name: :short_name,
  }, -> (api) { api.user_detail(canvas_id) })
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
canvas_sync-0.20.5 spec/dummy/app/models/user.rb
canvas_sync-0.20.4 spec/dummy/app/models/user.rb
canvas_sync-0.20.3 spec/dummy/app/models/user.rb
canvas_sync-0.19.1.beta2 spec/dummy/app/models/user.rb
canvas_sync-0.19.1.beta1 spec/dummy/app/models/user.rb
canvas_sync-0.19.0 spec/dummy/app/models/user.rb