Class: TenantKit::Current

Inherits:
ActiveSupport::CurrentAttributes
  • Object
show all
Defined in:
lib/tenant_kit/current.rb

Overview

Request-scoped holder for the current tenant, built on ActiveSupport::CurrentAttributes so state is automatically reset between requests (and between jobs) — never a raw thread-local, which would bleed across requests on a reused thread.

Instance Method Summary collapse

Instance Method Details

#scoping_disabledBoolean?

Internal flag toggled by TenantKit.without_tenant to disable scoping.

Returns:

  • (Boolean, nil)


14
# File 'lib/tenant_kit/current.rb', line 14

attribute :scoping_disabled

#tenantObject?

Returns the current tenant record.

Returns:

  • (Object, nil)

    the current tenant record.



10
# File 'lib/tenant_kit/current.rb', line 10

attribute :tenant