Sha256: 9cade9ea387bd2f9b93b63202780808f62d1870050a2c9ee666e81d7783d5b07

Contents?: true

Size: 537 Bytes

Versions: 2

Compression:

Stored size: 537 Bytes

Contents

module Rbacan
    class Role < ApplicationRecord
        self.table_name = Rbacan.role_table

        validates :name, presence: true, uniqueness: true
        
        has_many :role_permissions, class_name: Rbacan.role_permission_class, dependent: :destroy
        has_many :permissions, class_name: Rbacan.permission_class, through: :role_permissions

        has_many :user_roles, class_name: Rbacan.user_role_class, dependent: :destroy
        has_many :users, class_name: Rbacan.permittable_class, through: :user_roles
    end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rbacan-0.1.2 app/models/rbacan/role.rb
rbacan-0.1.1 app/models/rbacan/role.rb