PowAssent.Ecto.UserIdentities.Schema behaviour (PowAssent v0.4.10) View Source

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 the belongs_to association.

Link to this section Summary

Functions

Macro for adding user identity schema fields.

Link to this section Functions

Link to this function

changeset(user_identity_or_changeset, params, config)

View Source

Validates a user identity.

Link to this macro

pow_assent_user_identity_fields()

View Source (macro)

Specs

pow_assent_user_identity_fields() :: Macro.t()

Macro for adding user identity schema fields.

Link to this section Callbacks