Module: SolidAgent::Records
- Defined in:
- lib/solid_agent/records.rb,
lib/solid_agent/records/agent.rb,
lib/solid_agent/records/ownable.rb,
lib/solid_agent/records/agent_run.rb,
lib/solid_agent/records/agent_version.rb,
lib/solid_agent/records/agent_template.rb
Overview
Behavior for the agent-configuration records: the agent itself, its version history, the templates it can be created from, and its runs.
The gem ships behavior only. The model classes are host-owned — generated
into app/models by rails generate solid_agent:agents — and the gem
never defines or requires the Agent, AgentVersion, AgentTemplate or
AgentRun constants. That is deliberate, for three reasons:
- ActiveAgent's dashboard cannot depend on solid_agent — solid_agent already depends on activeagent, so the reverse edge would be a cycle. Naming the models with configurable strings and resolving them at call time is what lets both the dashboard and a plain host app read the same tables without either gem requiring the other.
- Engine-namespacing them as
SolidAgent::Agentwould makeisolate_namespaceresolve the table tosolid_agent_agents, and would invalidate thecontextable_type: "Agent"strings already persisted in productionagent_contextsrows. - Agent configuration is the thing applications most want to extend. A host-owned model can be edited; a gem-owned one can only be monkey-patched.
Defined Under Namespace
Modules: Agent, AgentRun, AgentTemplate, AgentVersion, Ownable
Constant Summary collapse
- MODELS =
Model names the gem resolves lazily, and their defaults.
{ agent_class: "Agent", agent_version_class: "AgentVersion", agent_template_class: "AgentTemplate", agent_run_class: "AgentRun" }.freeze