Sha256: a2123b9d6f1ef8072a675aadaafa856d0a188f08fef465447d80116df885188c

Contents?: true

Size: 777 Bytes

Versions: 29

Compression:

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

  canvas_sync_features :defaults

  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

29 entries across 29 versions & 1 rubygems

Version Path
canvas_sync-0.22.6 spec/dummy/app/models/role.rb
canvas_sync-0.22.5 spec/dummy/app/models/role.rb
canvas_sync-0.22.4 spec/dummy/app/models/role.rb
canvas_sync-0.22.3 spec/dummy/app/models/role.rb
canvas_sync-0.22.2 spec/dummy/app/models/role.rb
canvas_sync-0.22.1 spec/dummy/app/models/role.rb
canvas_sync-0.22.0 spec/dummy/app/models/role.rb
canvas_sync-0.22.0.beta8 spec/dummy/app/models/role.rb
canvas_sync-0.22.0.beta7 spec/dummy/app/models/role.rb
canvas_sync-0.22.0.beta6 spec/dummy/app/models/role.rb
canvas_sync-0.22.0.beta5 spec/dummy/app/models/role.rb
canvas_sync-0.22.0.beta4 spec/dummy/app/models/role.rb
canvas_sync-0.22.0.beta3 spec/dummy/app/models/role.rb
canvas_sync-0.22.0.beta2 spec/dummy/app/models/role.rb
canvas_sync-0.22.0.beta1 spec/dummy/app/models/role.rb
canvas_sync-0.21.1 spec/dummy/app/models/role.rb
canvas_sync-0.21.1.beta1 spec/dummy/app/models/role.rb
canvas_sync-0.21.0 spec/dummy/app/models/role.rb
canvas_sync-0.21.0.beta5 spec/dummy/app/models/role.rb
canvas_sync-0.21.0.beta4 spec/dummy/app/models/role.rb