Class: OpenLoam::TenantRecord
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- OpenLoam::TenantRecord
- 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.
Direct Known Subclasses
ApiToken, AuditRecord, BusinessRule, BusinessRuleRun, Comment, CustomFieldValue, DashboardWidget, Dictionary, DictionaryEntry, EventDelivery, EventRecord, FieldDefinition, InboundWebhookDelivery, InboundWebhookSource, Membership, Notification, PendingAction, Perspective, ProgressJob, RecordLock, ScheduledJob, SearchToken, SsoIdentity, SsoProvider, Translation, WebhookEndpoint