Sha256: cf23b96724c6664c5933487fe87de10cf4fb9b0fb92fa353160a6d8b8a9c129c
Contents?: true
Size: 850 Bytes
Versions: 4
Compression:
Stored size: 850 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::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, account: :account, 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}") }) def self.create_or_update(params); find_or_initialize_by(canvas_id: params['id']).update_from_api_params!(params); end end
Version data entries
4 entries across 4 versions & 1 rubygems