Skip to content

Commit

Permalink
Document usage of ParametrizedType inside of a composite type
Browse files Browse the repository at this point in the history
  • Loading branch information
tomekowal committed Dec 22, 2024
1 parent e644970 commit 039d219
Showing 1 changed file with 7 additions and 0 deletions.
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

0 comments on commit 039d219

Please sign in to comment.