get started on route for creating links, dividing steps into components

This commit is contained in:
2021-08-19 22:35:12 -04:00
parent 1542213875
commit dfaa328af4
24 changed files with 618 additions and 36 deletions

18
lib/entendu/links/link.ex Normal file
View File

@@ -0,0 +1,18 @@
defmodule Entendu.Links.Link do
use Ecto.Schema
import Ecto.Changeset
schema "links" do
field :burn_after_reading, :boolean, default: false
field :expires, :utc_datetime
timestamps()
end
@doc false
def changeset(link, attrs) do
link
|> cast(attrs, [:expires, :burn_after_reading])
|> validate_required([:expires, :burn_after_reading])
end
end