Sha256: 30d5b50cda13c2dd264d9d5eaa47dfe246bcb63397858d6e3bca705276384409

Contents?: true

Size: 584 Bytes

Versions: 82

Compression:

Stored size: 584 Bytes

Contents

# <%= autogenerated_model_warning %>

class Role < ApplicationRecord
  include CanvasSync::Record
  include CanvasSync::Concerns::ApiSyncable

  validates :canvas_id, uniqueness: true, presence: true
  has_many :admins, foreign_key: :canvas_role_id, primary_key: :canvas_id

  api_syncable({
    canvas_id: :id,
    label: :label,
    base_role_type: :base_role_type,
    canvas_account_id: ->(r) { r.dig('account', 'id') },
    permissions: :permissions,
    workflow_state: :workflow_state,
  }, -> (api) { api.get("/api/v1/accounts/#{canvas_account_id}/roles/#{canvas_id}") })
end

Version data entries

82 entries across 82 versions & 1 rubygems

Version Path
canvas_sync-0.14.0 lib/canvas_sync/generators/templates/models/role.rb
canvas_sync-0.13.0 lib/canvas_sync/generators/templates/models/role.rb