Files
runosaari.net/lib/runosaari/registration/performer.ex
2021-03-28 16:22:19 +03:00

24 lines
569 B
Elixir

defmodule Runosaari.Registration.Performer do
use Ecto.Schema
import Ecto.Changeset
schema "performers" do
field :confirmed, :boolean, default: false
field :email, :string
field :fname, :string
field :lname, :string
field :notes, :string
field :tel, :string
timestamps()
end
@doc false
def changeset(performer, attrs) do
performer
|> cast(attrs, [:fname, :lname, :email, :tel, :confirmed, :notes])
|> validate_required([:fname, :lname, :email, :tel, :confirmed, :notes])
|> unique_constraint(:email)
end
end