View Source PowAssent.Ecto.UserIdentities.Schema behaviour (PowAssent v0.4.18)
Handles the Ecto schema for user identity.
A default changeset/2
method is created, but can be overridden with a
custom changeset/2
method.
Usage
Configure lib/my_project/user_identities/user_identity.ex
the following way:
defmodule MyApp.UserIdentities.UserIdentity do
use Ecto.Schema
use PowAssent.Ecto.UserIdentities.Schema,
user: MyApp.Users.User
schema "user_identities" do
pow_assent_user_identity_fields()
timestamps()
end
def changeset(user_identity_or_changeset, attrs) do
pow_assent_changeset(user_identity_or_changeset, attrs)
end
end
Configuration options
:user
- the user schema module to use in thebelongs_to
association.
Summary
Callbacks
@callback changeset(Ecto.Schema.t() | Ecto.Changeset.t(), map()) :: Ecto.Changeset.t()
Functions
Validates a user identity.
@spec pow_assent_user_identity_fields() :: Macro.t()
Macro for adding user identity schema fields.