Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions lib/ecto/parameterized_type.ex
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,13 @@ defmodule Ecto.ParameterizedType do
field :bar, MyApp.MyType, opt1: :baz, opt2: :boo
end

To use this type in a schema field with a composite type, specify the type in a tuple
and opts afterwards.

schema "foo" do
field :bars, {:array, MyApp.MyType}, opt1: :baz, opt2: :boo
end

To use this type in places where you need it to be initialized (for example,
schemaless changesets), you can use `init/2`.

Expand Down
Loading