Sha256: 5bc2114c5e372412635f1fcb43890920382a4033168581cb4e6d6a33832e5c4d

Contents?: true

Size: 1.01 KB

Versions: 96

Compression:

Stored size: 1.01 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

  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

96 entries across 96 versions & 1 rubygems

Version Path
canvas_sync-0.19.0.beta10 spec/dummy/app/models/user.rb
canvas_sync-0.19.0.beta9 spec/dummy/app/models/user.rb
canvas_sync-0.19.0.beta8 spec/dummy/app/models/user.rb
canvas_sync-0.19.0.beta7 spec/dummy/app/models/user.rb
canvas_sync-0.19.0.beta6 spec/dummy/app/models/user.rb
canvas_sync-0.19.0.beta5 spec/dummy/app/models/user.rb
canvas_sync-0.19.0.beta4 spec/dummy/app/models/user.rb
canvas_sync-0.19.0.beta3 spec/dummy/app/models/user.rb
canvas_sync-0.19.0.beta2 spec/dummy/app/models/user.rb
canvas_sync-0.19.0.beta1 spec/dummy/app/models/user.rb
canvas_sync-0.18.12 spec/dummy/app/models/user.rb
canvas_sync-0.18.10 spec/dummy/app/models/user.rb
canvas_sync-0.18.9 spec/dummy/app/models/user.rb
canvas_sync-0.18.8 spec/dummy/app/models/user.rb
canvas_sync-0.18.7 spec/dummy/app/models/user.rb
canvas_sync-0.18.6 spec/dummy/app/models/user.rb
canvas_sync-0.18.5 spec/dummy/app/models/user.rb
canvas_sync-0.18.3 spec/dummy/app/models/user.rb
canvas_sync-0.18.2 spec/dummy/app/models/user.rb
canvas_sync-0.18.1 spec/dummy/app/models/user.rb