defmodule <%= user_schema %> do use <%= base %>.Web, :model use Coherence.Schema schema "<%= user_table_name %>" do field :name, :string field :email, :string coherence_schema timestamps end def changeset(model, params \\ %{}) do model |> cast(params, [:name, :email] ++ coherence_fields) |> validate_required([:name, :email]) |> unique_constraint(:email) |> validate_coherence(params) end end