Skip to content
This repository has been archived by the owner on Jun 12, 2020. It is now read-only.

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
Reflect on changes from last changes made with PR #5
  • Loading branch information
mdlkxzmcp authored Feb 25, 2019
1 parent 12e0016 commit 54fbc88
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,16 @@ end

### Add your attachment to your Ecto Schema

Add a using statement `use Arc.Ecto.Schema` to the top of your ecto schema, and specify the type of the column in your schema as `MyApp.Avatar.Type`.
Add an import statement `import Arc.Ecto.Changeset` to the top of your ecto schema, and specify the type of the column in your schema as `MyApp.Avatar.Type`.

Attachments can subsequently be passed to Arc's storage though a Changeset `cast_attachments/3` function, following the syntax of `cast/3`

```elixir
defmodule MyApp.User do
use MyApp.Web, :model
use Arc.Ecto.Schema
use Ecto.Schema

import Ecto.Changeset
import Arc.Ecto.Changeset

schema "users" do
field :name, :string
Expand Down

0 comments on commit 54fbc88

Please sign in to comment.