Sha256: fd731c90979d53d8d63520767eb57e6ff68026f9de1fc020faf9076dcb20bcb4

Contents?: true

Size: 555 Bytes

Versions: 3

Compression:

Stored size: 555 Bytes

Contents

module Authz
  class RoleGrant < self::ApplicationRecord
    # Associations
    # ==========================================================================
    belongs_to :role, class_name: 'Authz::Role',
                      foreign_key: 'authz_role_id',
                      inverse_of: :role_grants
    belongs_to :rolable, polymorphic: true

    # Validations
    # ===========================================================================
    validates :authz_role_id,
              uniqueness: { scope: [:rolable_type, :rolable_id] }
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
authz-0.0.2 app/models/authz/role_grant.rb
authz-0.0.1 app/models/authz/role_grant.rb
authz-0.0.1.alpha5 app/models/authz/role_grant.rb