Pow v0.1.0-alpha Pow.Extension.Ecto.Schema View Source

Handles extensions for the user Ecto schema.

Usage

Configure lib/my_project/user/user.ex the following way:

defmodule MyApp.Users.User do
  use Ecto.Schema
  use Pow.Ecto.Schema
  use Pow.Extension.Ecto.Schema,
    extensions: [PowExtensionOne, PowExtensionTwo]

  schema "users" do
    pow_user_fields()

    timestamps()
  end

  def changeset(user_or_changeset, attrs) do
    user
    |> pow_changeset(attrs)
    |> pow_extension_changeset(attrs)
  end
end

Link to this section Summary

Link to this section Functions

Link to this function attrs(config, login_field) View Source
attrs(Pow.Config.t(), atom()) :: [tuple()]
Link to this function changeset(changeset, attrs, config) View Source