Exception: Apartment::TenantRequired
- Inherits:
-
ApartmentError
- Object
- StandardError
- ApartmentError
- Apartment::TenantRequired
- Defined in:
- lib/apartment/errors.rb
Overview
Raised by Apartment::Tenant.require_tenant! when the effective tenant is the default (or unset) — routed data must not land in the default keyspace.
Instance Attribute Summary collapse
-
#current ⇒ Object
readonly
Returns the value of attribute current.
Instance Method Summary collapse
-
#initialize(current = nil) ⇒ TenantRequired
constructor
A new instance of TenantRequired.
Constructor Details
#initialize(current = nil) ⇒ TenantRequired
Returns a new instance of TenantRequired.
88 89 90 91 92 93 94 95 96 |
# File 'lib/apartment/errors.rb', line 88 def initialize(current = nil) @current = current super( 'Expected an explicit, non-default tenant context, but the effective ' \ "tenant is #{current.inspect}. Wrap the work in " \ 'Apartment::Tenant.switch(name) { ... } — routed data must not use the ' \ 'default keyspace.' ) end |
Instance Attribute Details
#current ⇒ Object (readonly)
Returns the value of attribute current.
86 87 88 |
# File 'lib/apartment/errors.rb', line 86 def current @current end |