20 lines
387 B
Elixir
20 lines
387 B
Elixir
defmodule Faces.Gallery.Person do
|
|
use Ecto.Schema
|
|
import Ecto.Changeset
|
|
|
|
|
|
schema "people" do
|
|
field :avatar_url, :string
|
|
field :location, :string
|
|
field :name, :string
|
|
|
|
timestamps()
|
|
end
|
|
|
|
@doc false
|
|
def changeset(person, attrs) do
|
|
person
|
|
|> cast(attrs, [:name, :location, :avatar_url])
|
|
|> validate_required([:name, :location, :avatar_url])
|
|
end
|
|
end
|