Class: Acta::EventsRecord
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Acta::EventsRecord
- Defined in:
- lib/acta/record.rb
Overview
Abstract intermediate. The actual events table lives on ‘Acta::Record` below; this class exists so hosts can call `connects_to` (which ActiveRecord rejects on concrete classes that have `table_name` set).
Default behaviour: inherits from ActiveRecord::Base, no shard or connection routing — Acta::Record uses whatever the host’s default connection is.
Hosts that need the events table to *share a connection pool* with their own tenant-scoped abstract base (so writes inside a single transaction don’t fight across pools on the same SQLite file) re-parent EventsRecord via ‘Acta.set_events_record_parent!`:
# config/initializers/_acta_record_parent.rb
class TenantRecord < ActiveRecord::Base
self.abstract_class = true
end
Acta.set_events_record_parent!(TenantRecord)
# then call connects_to on TenantRecord — Acta::Record rides along
Acta::Record inherits from EventsRecord so any routing applied to EventsRecord (or to a re-parented ancestor) automatically applies.