Schema helpers for referencing static lookup modules from Ecto schemas.
Usage
import StaticContext.Schema
schema "articles" do
static_belongs_to :category, Categories
end
Summary
Functions
Declares a belongs_to-style relationship to a static lookup module.
Functions
Declares a belongs_to-style relationship to a static lookup module.
Generates two fields: a _id string field for DB storage, and a virtual field
backed by StaticContext.Type that loads the full struct on read.
Example
static_belongs_to :category, CategoriesExpands to:
field :category_id, :string
field :category, StaticContext.Type, module: Categories, source: :category_id