2018-01-13 23:33:03 +01:00
|
|
|
defmodule Eventos.Groups.Request do
|
2017-12-08 09:58:14 +01:00
|
|
|
use Ecto.Schema
|
|
|
|
import Ecto.Changeset
|
2018-01-13 23:33:03 +01:00
|
|
|
alias Eventos.Groups.Request
|
|
|
|
|
2017-12-08 09:58:14 +01:00
|
|
|
|
|
|
|
schema "group_requests" do
|
|
|
|
field :state, :integer
|
|
|
|
field :group_id, :integer
|
|
|
|
field :account_id, :integer
|
|
|
|
|
|
|
|
timestamps()
|
|
|
|
end
|
|
|
|
|
|
|
|
@doc false
|
2018-01-13 23:33:03 +01:00
|
|
|
def changeset(%Request{} = request, attrs) do
|
|
|
|
request
|
2017-12-08 09:58:14 +01:00
|
|
|
|> cast(attrs, [:state])
|
|
|
|
|> validate_required([:state])
|
|
|
|
end
|
|
|
|
end
|