Exception: Apartment::FixtureLifecycleViolation
- Inherits:
-
ApartmentError
- Object
- StandardError
- ApartmentError
- Apartment::FixtureLifecycleViolation
- Defined in:
- lib/apartment/errors.rb
Overview
Raised when a pool-lifecycle API (e.g. reset_tenant_pools!) is invoked while Rails’ transactional fixtures own one or more tenant pools. Discarding a pinned pool mid-fixture-tx leaves the next example’s fixture-setup snapshot without those pools; the recreated pool has a fresh object identity that never enrols in the rollback. Test-env-scoped — production callers are unaffected.
See docs/testing.md for the consumer-facing opt-out recipe and docs/designs/fixture-pool-lifecycle.md for the failure-class design.
Instance Attribute Summary collapse
-
#pool_key ⇒ Object
readonly
Returns the value of attribute pool_key.
Instance Method Summary collapse
-
#initialize(pool_key = nil, message: nil) ⇒ FixtureLifecycleViolation
constructor
A new instance of FixtureLifecycleViolation.
Constructor Details
#initialize(pool_key = nil, message: nil) ⇒ FixtureLifecycleViolation
Returns a new instance of FixtureLifecycleViolation.
51 52 53 54 |
# File 'lib/apartment/errors.rb', line 51 def initialize(pool_key = nil, message: nil) @pool_key = pool_key super( || ) end |
Instance Attribute Details
#pool_key ⇒ Object (readonly)
Returns the value of attribute pool_key.
49 50 51 |
# File 'lib/apartment/errors.rb', line 49 def pool_key @pool_key end |