Pow v1.0.8 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
@impl true
def attrs(_config) do
[{:custom_field, :string}]
end
@impl true
def changeset(changeset, _config) do
Ecto.Changeset.validate_required(changeset, [:custom_field])
end
end
Link to this section Summary
Link to this section Callbacks
Link to this callback
assocs(arg0)
View Source
assocs(arg0)
View Source
assocs(Pow.Config.t()) :: [tuple()]
assocs(Pow.Config.t()) :: [tuple()]
Link to this callback
attrs(arg0)
View Source
attrs(arg0)
View Source
attrs(Pow.Config.t()) :: [tuple()]
attrs(Pow.Config.t()) :: [tuple()]
Link to this callback
changeset(arg0, map, arg2)
View Source
changeset(arg0, map, arg2)
View Source
changeset(Ecto.Changeset.t(), map(), Pow.Config.t()) :: Ecto.Changeset.t()
changeset(Ecto.Changeset.t(), map(), Pow.Config.t()) :: Ecto.Changeset.t()
Link to this callback
indexes(arg0)
View Source
indexes(arg0)
View Source
indexes(Pow.Config.t()) :: [tuple()]
indexes(Pow.Config.t()) :: [tuple()]
Link to this callback
validate!(arg0, atom)
View Source
validate!(arg0, atom)
View Source
validate!(Pow.Config.t(), atom()) :: :ok | no_return()
validate!(Pow.Config.t(), atom()) :: :ok | no_return()