mirror of
https://framagit.org/framasoft/mobilizon.git
synced 2024-12-25 01:12:30 +00:00
cac4dd3ca3
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
25 lines
489 B
Elixir
25 lines
489 B
Elixir
defmodule Eventos.Actors.Bot do
|
|
@moduledoc """
|
|
Represents a local bot
|
|
"""
|
|
use Ecto.Schema
|
|
import Ecto.Changeset
|
|
alias Eventos.Actors.{Actor, User, Bot}
|
|
|
|
|
|
schema "bots" do
|
|
field :source, :string
|
|
field :type, :string, default: :ics
|
|
belongs_to :actor, Actor
|
|
belongs_to :user, User
|
|
|
|
timestamps()
|
|
end
|
|
|
|
@doc false
|
|
def changeset(bot, attrs) do
|
|
bot
|
|
|> cast(attrs, [:source, :type, :actor_id, :user_id])
|
|
|> validate_required([:source])
|
|
end
|
|
end
|