Sha256: 256a3dfbb7d0941686caf1d13ce1d0b4710830c6f68b52c9a98c58e0ea777ff2

Contents?: true

Size: 539 Bytes

Versions: 3

Compression:

Stored size: 539 Bytes

Contents

module Authz
  class RoleGrant < ApplicationRecord
    # Associations
    # ==========================================================================
    belongs_to :role, class_name: 'Authz::Role',
                      foreign_key: 'authz_role_id',
                      optional: true
    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.1.alpha4 app/models/authz/role_grant.rb
authz-0.0.1.alpha3 app/models/authz/role_grant.rb
authz-0.0.1.alpha2 app/models/authz/role_grant.rb