Exception: Apartment::FixtureLifecycleViolation

Inherits:
ApartmentError
  • Object
show all
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

Instance Method Summary collapse

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(message || default_message)
end

Instance Attribute Details

#pool_keyObject (readonly)

Returns the value of attribute pool_key.



49
50
51
# File 'lib/apartment/errors.rb', line 49

def pool_key
  @pool_key
end