Class: OpenLoam::CustomFieldValue

Inherits:
TenantRecord
  • Object
show all
Defined in:
app/models/open_loam/custom_field_value.rb

Overview

A read-model projection of ONE custom field of ONE record into typed, INDEXED columns — so filtering/sorting/searching on a custom field is index-backed instead of a per-row JSON extraction over the custom_fields column (which can't be indexed and full-scans at scale). One row per (record, custom field); maintained by OpenLoam::CustomFieldIndex from the OpenLoam::CustomFields save/destroy hooks. Tenant-scoped.

The value is written into the column matching the field's declared type (value_number / value_boolean / value_datetime) AND always into value_text (its string form) for text ops (contains/present) and canonical equality.