Skip to content

Commit f069958

Browse files
authored
Document usage of ParametrizedType inside of a composite type (#4559)
1 parent e644970 commit f069958

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/ecto/parameterized_type.ex

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,13 @@ defmodule Ecto.ParameterizedType do
6464
field :bar, MyApp.MyType, opt1: :baz, opt2: :boo
6565
end
6666
67+
To use this type in a schema field with a composite type, specify the type in a tuple
68+
and opts afterwards.
69+
70+
schema "foo" do
71+
field :bars, {:array, MyApp.MyType}, opt1: :baz, opt2: :boo
72+
end
73+
6774
To use this type in places where you need it to be initialized (for example,
6875
schemaless changesets), you can use `init/2`.
6976

0 commit comments

Comments
 (0)