Exception: Rhino::MissingTenantContext

Inherits:
StandardError
  • Object
show all
Defined in:
lib/rhino/missing_tenant_context.rb

Overview

Raised by Rhino.query (and the explicit builder) when an organization-scopable model is queried with no organization context available. Fail-closed: the resolver never returns an unscoped relation for a tenant-scopable model.

Instance Method Summary collapse

Constructor Details

#initialize(model_class = nil) ⇒ MissingTenantContext

Returns a new instance of MissingTenantContext.



8
9
10
11
12
13
14
15
# File 'lib/rhino/missing_tenant_context.rb', line 8

def initialize(model_class = nil)
  super(
    "Rhino.query(#{model_class}) requires an organization context but none is set. " \
    "Use Rhino.for_user(...).in_organization(...) outside a tenant request, or declare " \
    "the route group serving this request non-tenant with `tenant: false` if it " \
    "legitimately spans every organization."
  )
end