425 B · text 5af55d9
defmodule GitGud.Federation.ActorBlock do
use Ecto.Schema
import Ecto.Changeset
schema "fed_actor_blocks" do
field :actor_url, :string
field :reason, :string
timestamps(type: :utc_datetime)
end
def changeset(b, attrs) do
b
|> cast(attrs, [:actor_url, :reason])
|> validate_required([:actor_url])
|> validate_length(:actor_url, max: 500)
|> unique_constraint(:actor_url)
end
end