Sha256: 897e4127f4f9d22186d8f686997810b33bc46405e07808fda3b2c43634c0f84f

Contents?: true

Size: 871 Bytes

Versions: 80

Compression:

Stored size: 871 Bytes

Contents

# <%= autogenerated_model_warning %>

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

80 entries across 80 versions & 1 rubygems

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