PowAssent v0.1.0 PowAssent.Ecto.UserIdentities.Schema behaviour 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(updated_at: false)
  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)
pow_assent_user_identity_fields() :: Macro.t()

Macro for adding user identity schema fields.

Link to this section Callbacks