22 lines
447 B
Elixir
22 lines
447 B
Elixir
|
defmodule Frenzy.ApprovedClient do
|
||
|
use Ecto.Schema
|
||
|
import Ecto.Changeset
|
||
|
|
||
|
schema "approved_clients" do
|
||
|
field :client_id, :string
|
||
|
field :auth_code, :string
|
||
|
field :access_token, :string
|
||
|
|
||
|
belongs_to :user, Frenzy.User
|
||
|
|
||
|
timestamps()
|
||
|
end
|
||
|
|
||
|
@doc false
|
||
|
def changeset(approved_client, attrs) do
|
||
|
approved_client
|
||
|
|> cast(attrs, [:client_id, :auth_code, :access_token])
|
||
|
|> validate_required([:client_id])
|
||
|
end
|
||
|
end
|