This repository has been archived on 2024-06-24. You can view files and clone it, but cannot push or open issues or pull requests.
graphql-lightning-talk/lib/faces/gallery/person.ex

21 lines
387 B
Elixir
Raw Normal View History

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