Sha256: f2c63bc4a8aabe1909e30793118b8791d35a5e14f7b7e20e9a54594725ed30cd

Contents?: true

Size: 386 Bytes

Versions: 2

Compression:

Stored size: 386 Bytes

Contents

# frozen_string_literal: true

# Class modeling Roles within the application
class Role < ApplicationRecord
  has_and_belongs_to_many :users

  validates :name,
            uniqueness: true,
            format: {
              with: /\A[a-zA-Z0-9._-]+\z/,
              message: 'Only letters, numbers, hyphens, ' \
              'underscores and periods are allowed'
            }
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
hydra-role-management-1.2.0 app/models/role.rb
hydra-role-management-1.1.0 app/models/role.rb