mobilizon.chapril.org-mobil.../lib/eventos/events/request.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
442 B
Elixir

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