- Fix usage with Ecto 3.12. Require Ecto 3.12 or later
- Allow inferring type from parent field via new :use_parent_field_for_type option
- Add
Form.source_data/1
andForm.source_module/1
(get_polymorphic_type/2
doesn't work for list of embeds) - Add
:retain_unlisted_types_on_load
and:nilify_unlisted_types_on_load
options - MongoDB fix
- Deprecate
:type_field
in favor of:type_field_name
- Support
sort_param
anddrop_param
for list of embeds - Add
PolymorphicEmbed.HTML.Component.polymorphic_embed_inputs_for/1
(similar toPhoenix.Component.inputs_for/1
) - Support updating list of embeds while retaining ids
- Fix form input rendering for list of embeds
- Fix
traverse_errors
for nested embeds
Breaking Change: The form helper get_polymorphic_type/3
has been updated to get_polymorphic_type/2
.
The module name parameter (previously the second parameter) has been removed.
- Default value for polymorphic list of embeds is
[]
instead ofnil
(followingembeds_many/3
) - Support Phoenix HTML 4.0
- Avoid compile-time dependencies between parent and polymorphic embedded schemas
- Use
polymorphic_embeds_one/2
andpolymorphic_embeds_many/2
macros instead offield/3
- Support IDs
- Make sure that every existing polymorphic
embedded_schema
contains the setting@primary_key false
- Add
polymorphic_embed_inputs_for/2
for displaying forms in LiveView - Add
polymorphic_embed_inputs_for/3
for displaying forms in Phoenix templates without needing to specify the type
- Add
PolymorphicEmbed.types/2
function returning the possible types for a polymorphic field
- Add
:nilify
and:ignore
for:on_type_not_found
option
- Support the SQLite3 Ecto adapter
ecto_sqlite3
- Fix errors in form for
embeds_one
nested intopolymorphic_embed
- Refactor
PolymorphicEmbed.HTML.Form
- Add
traverse_errors/2
- Support custom changeset functions through
:with
option
- Add
:required
option
- Support custom type field
- Support list of polymorphic embeds
- Force
:on_replace
option to be explicitly set