Packages

'Mail merging' with Ecto structs. A parser to interpolate MediaWiki-like `[[foo.bar]]` markup using data from Ecto schemas.

Current section

Files

Jump to
mecto lib custom_schema.ex
Raw

lib/custom_schema.ex

import ProtocolEx
defprotocol_ex Mecto.CustomSchema do
@moduledoc """
The `protocol_ex` protocol used to create schemas for custom Ecto types.
"""
def type(module, field)
end
defimpl_ex Ecto.Enum, Ecto.Enum, for: Mecto.CustomSchema do
@moduledoc """
Implementation of `Mecto.CustomSchema` for `Ecto.Enum`, using `protocol_ex`.
"""
def type(Ecto.Enum, %{type: type}), do: type
end