mobilizon/lib/eventos/events/event_accounts.ex
Thomas Citharel 90ceb4f6fe initial commit
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2017-12-08 09:58:14 +01:00

23 lines
495 B
Elixir

defmodule Eventos.Events.EventAccounts do
use Ecto.Schema
import Ecto.Changeset
alias Eventos.Events.{EventAccounts, Event}
alias Eventos.Accounts.Account
@primary_key false
schema "event_accounts" do
field :roles, :integer
belongs_to :event, Event
belongs_to :account, Account
timestamps()
end
@doc false
def changeset(%EventAccounts{} = event_accounts, attrs) do
event_accounts
|> cast(attrs, [:roles])
|> validate_required([:roles])
end
end