Class: OpenLoam::TenantRecord

Inherits:
ActiveRecord::Base
  • Object
show all
Includes:
GeneratedKey
Defined in:
lib/open_loam/tenant_record.rb

Overview

Base class for every tenant-scoped model. Inheriting from it is what makes a model a "OpenLoam entity":

* every query is scoped to OpenLoam::Current.tenant via default_scope
* building/creating a record assigns the current tenant automatically
* touching the model with NO tenant in context raises MissingTenantError

Escape hatch: Model.unscoped skips the scope. It is deliberately the standard Rails spelling so it is trivially greppable in review, and AGENTS.md forbids agents from using it.

Method Summary

Methods included from GeneratedKey

included