Exception: Apartment::DefaultTenantRequired
- Inherits:
-
ApartmentError
- Object
- StandardError
- ApartmentError
- Apartment::DefaultTenantRequired
- Defined in:
- lib/apartment/errors.rb
Overview
Raised by Apartment::Tenant.require_default_tenant! when the effective tenant is a real (non-default) tenant — pinned/global work must run in the default.
Instance Attribute Summary collapse
-
#current ⇒ Object
readonly
Returns the value of attribute current.
-
#default ⇒ Object
readonly
Returns the value of attribute default.
Instance Method Summary collapse
-
#initialize(current = nil, default = nil) ⇒ DefaultTenantRequired
constructor
A new instance of DefaultTenantRequired.
Constructor Details
#initialize(current = nil, default = nil) ⇒ DefaultTenantRequired
Returns a new instance of DefaultTenantRequired.
104 105 106 107 108 109 110 111 112 |
# File 'lib/apartment/errors.rb', line 104 def initialize(current = nil, default = nil) @current = current @default = default super( "Expected the default tenant #{default.inspect}, but the effective " \ "tenant is #{current.inspect}. Wrap pinned/global work in " \ 'Apartment::Tenant.with_default_tenant { ... }.' ) end |
Instance Attribute Details
#current ⇒ Object (readonly)
Returns the value of attribute current.
102 103 104 |
# File 'lib/apartment/errors.rb', line 102 def current @current end |
#default ⇒ Object (readonly)
Returns the value of attribute default.
102 103 104 |
# File 'lib/apartment/errors.rb', line 102 def default @default end |