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.
117 118 119 120 121 122 123 124 125 |
# File 'lib/apartment/errors.rb', line 117 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.
115 116 117 |
# File 'lib/apartment/errors.rb', line 115 def current @current end |