19 lines
381 B
Ruby
19 lines
381 B
Ruby
# == Schema Information
|
|
#
|
|
# Table name: roles
|
|
#
|
|
# id :bigint not null, primary key
|
|
# name :string
|
|
# created_at :datetime not null
|
|
# updated_at :datetime not null
|
|
#
|
|
# Indexes
|
|
#
|
|
# index_roles_on_name (name) UNIQUE
|
|
#
|
|
class Role < ApplicationRecord
|
|
has_and_belongs_to_many :users
|
|
|
|
validates :name, presence: true, uniqueness: true
|
|
end
|