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

Handles extensions for the user Ecto schema.

Usage

Configure lib/my_project/users/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 changeset(changeset, attrs, config) View Source
Link to this function require_schema_field!(module, field, extension) View Source
require_schema_field!(atom(), atom(), atom()) :: :ok | no_return()
Link to this function validate!(config, module) View Source
validate!(Pow.Config.t(), atom()) :: :ok | no_return()