Packages

Anka.Ecto helps to create Ecto schemas and their context functions with optionally definable pre/post processors that prepare CRUDL resources from models based on Anka.Model.

Current section

Files

Jump to
anka_ecto lib anka_ecto schema.ex
Raw

lib/anka_ecto/schema.ex

defmodule Anka.Ecto.Schema do
defmacro __using__(opts \\ []) do
{model, opts} = Keyword.pop(opts, :model, nil)
quote do
require Anka.Ecto.Generators.SchemaGenerator
Anka.Ecto.Generators.SchemaGenerator.generate_from_model(unquote(model), unquote(opts))
end
end
end