# `StaticContext.Schema`
[🔗](https://github.com/exfoundry/static_context/blob/v0.1.0/lib/static_context/schema.ex#L1)

Schema helpers for referencing static lookup modules from Ecto schemas.

## Usage

    import StaticContext.Schema

    schema "articles" do
      static_belongs_to :category, Categories
    end

# `static_belongs_to`
*macro* 

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, Categories

Expands to:

    field :category_id, :string
    field :category, StaticContext.Type, module: Categories, source: :category_id

---

*Consult [api-reference.md](api-reference.md) for complete listing*
