Pow v1.0.0-rc.0 Pow.Extension.Ecto.Schema.Base behaviour View Source

Used for extensions to extend user schemas.

The macro will add fallback methods to the module, that can be overridden.

Usage

defmodule MyPowExtension.Ecto.Schema do
  use Pow.Extension.Ecto.Schema.Base

  def attrs(_config) do
    [{:custom_field, :string}]
  end

  def changeset(changeset, _config) do
    changeset
    |> Ecto.Changeset.validate_required([:custom_field])
  end
end

Link to this section Summary

Link to this section Callbacks

Link to this callback validate!(arg0, atom) View Source
validate!(Pow.Config.t(), atom()) :: :ok | no_return()