Sha256: 1faa31a12955f864a2a90366a18dab1712a2a59419da31c5c1aab922a84fdd49
Contents?: true
Size: 1.37 KB
Versions: 5
Compression:
Stored size: 1.37 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 # include CanvasSync::Concerns::LiveEventSync # around_process_live_event do |blk| # blk.call # rescue Footrest::HttpError::Unauthorized => e # # This can happen when a new user is created, but hasn't setup a login on Canvas yet. # Rails.logger.info("Failed to fetch user #{canvas_user_id}: #{e.backtrace}") # end 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
5 entries across 5 versions & 1 rubygems