Sha256: 847b48dc24986cf5ed5b3655af9d78bca40c0798382ff830979eccf26f28b9f5

Contents?: true

Size: 743 Bytes

Versions: 104

Compression:

Stored size: 743 Bytes

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 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

104 entries across 104 versions & 1 rubygems

Version Path
canvas_sync-0.15.1 spec/dummy/app/models/role.rb
canvas_sync-0.15.0 spec/dummy/app/models/role.rb
canvas_sync-0.14.0 spec/dummy/app/models/role.rb
canvas_sync-0.13.0 spec/dummy/app/models/role.rb