create gists
This commit is contained in:
parent
79a17290d5
commit
43a8412f06
90 changed files with 1777 additions and 2107 deletions
18
lib/zoeyscomputer/gists/gist.ex
Normal file
18
lib/zoeyscomputer/gists/gist.ex
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
defmodule Zoeyscomputer.Gists.Gist do
|
||||
use Ecto.Schema
|
||||
import Ecto.Changeset
|
||||
|
||||
schema "gists" do
|
||||
field :code, :string
|
||||
field :lang, :string
|
||||
|
||||
timestamps(type: :utc_datetime)
|
||||
end
|
||||
|
||||
@doc false
|
||||
def changeset(gist, attrs) do
|
||||
gist
|
||||
|> cast(attrs, [:code, :lang])
|
||||
|> validate_required([:code, :lang])
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue