1
0
Fork 0
mirror of https://framagit.org/framasoft/mobilizon.git synced 2025-01-05 07:02:56 +00:00
mobilizon/lib/eventos/groups/member.ex
Thomas Citharel 20cd1bb579 Change models, new migrations, fix front and make tests work
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2018-01-13 23:33:03 +01:00

22 lines
428 B
Elixir

defmodule Eventos.Groups.Member do
use Ecto.Schema
import Ecto.Changeset
alias Eventos.Groups.{Member, Group}
alias Eventos.Accounts.Account
schema "members" do
field :role, :integer
belongs_to :group, Group
belongs_to :account, Account
timestamps()
end
@doc false
def changeset(%Member{} = member, attrs) do
member
|> cast(attrs, [:role])
|> validate_required([:role])
end
end