Skip to content

Commit

Permalink
Document usage of ParametrizedType inside of a composite type (#4559)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomekowal authored Dec 22, 2024
1 parent e644970 commit f069958
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 f069958

Please sign in to comment.