Update activity
This commit is contained in:
parent
0c2777eb12
commit
144bfb57e2
2 changed files with 5 additions and 1 deletions
|
@ -11,6 +11,8 @@ defmodule Nulla.Models.Activity do
|
||||||
field :type, :string
|
field :type, :string
|
||||||
field :actor, :string
|
field :actor, :string
|
||||||
field :object, :string
|
field :object, :string
|
||||||
|
field :to, :string
|
||||||
|
field :cc, :string
|
||||||
|
|
||||||
timestamps()
|
timestamps()
|
||||||
end
|
end
|
||||||
|
@ -18,7 +20,7 @@ defmodule Nulla.Models.Activity do
|
||||||
@doc false
|
@doc false
|
||||||
def changeset(activity, attrs) do
|
def changeset(activity, attrs) do
|
||||||
activity
|
activity
|
||||||
|> cast(attrs, [:ap_id, :type, :actor, :object])
|
|> cast(attrs, [:ap_id, :type, :actor, :object, :to, :cc])
|
||||||
|> validate_required([:ap_id, :type, :actor, :object])
|
|> validate_required([:ap_id, :type, :actor, :object])
|
||||||
|> validate_inclusion(:type, ~w(Create Update Delete Undo Like Announce Follow Accept Reject))
|
|> validate_inclusion(:type, ~w(Create Update Delete Undo Like Announce Follow Accept Reject))
|
||||||
end
|
end
|
||||||
|
|
|
@ -8,6 +8,8 @@ defmodule Nulla.Repo.Migrations.CreateActivities do
|
||||||
add :type, :string, null: false
|
add :type, :string, null: false
|
||||||
add :actor, :string, null: false
|
add :actor, :string, null: false
|
||||||
add :object, :text, null: false
|
add :object, :text, null: false
|
||||||
|
add :to, :text
|
||||||
|
add :cc, :text
|
||||||
|
|
||||||
timestamps()
|
timestamps()
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue