Spec improvements

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2021-09-27 09:41:36 +02:00
parent cc3106e425
commit 41f086e2c9
21 changed files with 299 additions and 90 deletions

View File

@@ -0,0 +1,27 @@
defmodule Mobilizon.Actors.Member.Metadata do
@moduledoc """
Represents metadata on a membership
"""
use Ecto.Schema
import Ecto.Changeset
@type t :: %__MODULE__{}
@required_attrs []
@optional_attrs []
@attrs @required_attrs ++ @optional_attrs
embedded_schema do
# TODO : Use this space to put notes when someone is invited / requested to join
end
@doc false
@spec changeset(t | Ecto.Schema.t(), map) :: Ecto.Changeset.t()
def changeset(schema, params) do
schema
|> cast(params, @attrs)
end
end