Sha256: ac39366507b5c88cf6bcd2ca8de196490ed75d396430a5898f24177129a7f115
Contents?: true
Size: 867 Bytes
Versions: 42
Compression:
Stored size: 867 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 validates :canvas_role_id, uniqueness: true, presence: true has_many :admins, foreign_key: :canvas_role_id, primary_key: :canvas_role_id def self.create_or_update(role_params) role = Role.find_or_initialize_by(canvas_role_id: role_params['id']) role.assign_attributes(label: role_params['label'], base_role_type: role_params['base_role_type'], account: role_params['account'], permissions: role_params['permissions'], workflow_state: role_params['workflow_state']) role.save! if role.changed? role end end
Version data entries
42 entries across 42 versions & 1 rubygems