From 65583ecf51f3f2e798e5648cd7b1387c310badfd Mon Sep 17 00:00:00 2001 From: Matthieu Pinte Date: Thu, 27 Jul 2017 13:44:30 +0200 Subject: [PATCH] up README with sample --- README.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/README.md b/README.md index c8ccde1..b2706f4 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,25 @@ def deps do end ``` +## Use + +```elixir +defmodule MyApp.User do + use MyApp.Web, :model + + @primary_key {:id, :binary_id, autogenerate: true} + @derive {Phoenix.Param, key: :id} + + schema "users" do + field :email, :string + field :provider, Ecto.Atom # :github => 'github' in DB + field :uid, :string + field :token, :string + ... + end +end +``` + Documentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc) and published on [HexDocs](https://hexdocs.pm). Once published, the docs can be found at [https://hexdocs.pm/ecto_atom](https://hexdocs.pm/ecto_atom).