Class: Glib::PlainModel
- Inherits:
-
Object
- Object
- Glib::PlainModel
- Defined in:
- app/models/glib/plain_model.rb
Overview
Marker base for PLAIN domain objects: domain logic under app/models that
neither persists (no table — not ApplicationRecord) nor backs a form or
request (no params/validations/errors — not ApplicationModel). Catalogs,
derivations, tallies, write-orchestration helpers. Apps inherit through a
thin PlainModel < Glib::PlainModel root; the base-choosing guide lives on
Glib::Model.
Deliberately empty: what plain domain objects share is a CONTRACT, not mechanics —
- domain logic only: no external I/O (HTTP clients and provider SDKs belong in app/services adapters);
- no enqueues (
perform_later/deliver_laterare the calling controller's or job's trigger); - writes, when any, go through the ActiveRecord models whose invariants they are. Inheriting this class is the author's declaration that the contract holds. The moment a subclass wants shared BEHAVIOR from here, that behavior belongs in Glib::Model or a concern instead — this base stays a classification, so that inheriting it keeps meaning exactly one thing.