Exception: PgRls::Errors::TenantNotFound
- Inherits:
-
StandardError
- Object
- StandardError
- PgRls::Errors::TenantNotFound
- Defined in:
- lib/pg_rls/errors/tenant_not_found.rb
Overview
Raise Tenant Not found and ensure that the tenant is resetted
Instance Method Summary collapse
-
#initialize(msg = nil) ⇒ TenantNotFound
constructor
A new instance of TenantNotFound.
- #message ⇒ Object
- #reset_tenant_id ⇒ Object
Constructor Details
#initialize(msg = nil) ⇒ TenantNotFound
Returns a new instance of TenantNotFound.
7 8 9 10 11 |
# File 'lib/pg_rls/errors/tenant_not_found.rb', line 7 def initialize(msg = nil) reset_tenant_id @msg = msg super(msg) end |
Instance Method Details
#message ⇒ Object
13 14 15 |
# File 'lib/pg_rls/errors/tenant_not_found.rb', line 13 def @msg || "Tenant Doesn't exist" end |
#reset_tenant_id ⇒ Object
17 18 19 |
# File 'lib/pg_rls/errors/tenant_not_found.rb', line 17 def reset_tenant_id PgRls.connection_class.connection.execute('RESET rls.tenant_id') end |