Skip to content

Commit c4295c6

Browse files
committed
Bump version to 4.0.0
1 parent 51d8826 commit c4295c6

3 files changed

Lines changed: 16 additions & 5 deletions

File tree

CHANGELOG.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,22 @@
11
# Changelog
22

3+
## 4.0.x
4+
5+
* Support `sort_param` and `drop_param` for list of embeds
6+
* Add `PolymorphicEmbed.HTML.Component.polymorphic_embed_inputs_for/1`
7+
(similar to `Phoenix.Component.inputs_for/1`)
8+
* Support updating list of embeds while retaining ids
9+
* Fix form input rendering for list of embeds
10+
* Fix traverse_errors for nested embeds
11+
12+
**Breaking Change**: The form helper `get_polymorphic_type/3` has been updated to `get_polymorphic_type/2`.
13+
The module name parameter (previously the second parameter) has been removed.
14+
315
## 3.0.x
416

517
* Default value for polymorphic list of embeds is `[]` instead of `nil` (following `embeds_many/3`)
618
* Support Phoenix HTML 4.0
719
* Avoid compile-time dependencies between parent and polymorphic embedded schemas
8-
* Support updating list of embeds while retaining ids
920

1021
### Migration from 2.x to 3.x
1122

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ You may use `polymorphic_embed_inputs_for/2` when working with LiveView.
228228
<%= for channel_form <- polymorphic_embed_inputs_for f, :channel do %>
229229
<%= hidden_inputs_for(channel_form) %>
230230

231-
<%= case get_polymorphic_type(f, Reminder, :channel) do %>
231+
<%= case get_polymorphic_type(f, :channel) do %>
232232
<% :sms -> %>
233233
<%= label channel_form, :number %>
234234
<%= text_input channel_form, :number %>
@@ -246,7 +246,7 @@ Using this function, you have to render the necessary hidden inputs manually as
246246
### Get the type of a polymorphic embed
247247

248248
Sometimes you need to serialize the polymorphic embed and, once in the front-end, need to distinguish them.
249-
`get_polymorphic_type/3` returns the type of the polymorphic embed:
249+
`PolymorphicEmbed.get_polymorphic_type/3` returns the type of the polymorphic embed:
250250

251251
```elixir
252252
PolymorphicEmbed.get_polymorphic_type(Reminder, :channel, SMS) == :sms
@@ -272,7 +272,7 @@ Add `polymorphic_embed` for Elixir as a dependency in your `mix.exs` file:
272272
```elixir
273273
def deps do
274274
[
275-
{:polymorphic_embed, "~> 3.0.7"}
275+
{:polymorphic_embed, "~> 4.0.0"}
276276
]
277277
end
278278
```

mix.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
defmodule PolymorphicEmbed.MixProject do
22
use Mix.Project
33

4-
@version "3.0.7"
4+
@version "4.0.0"
55

66
def project do
77
[

0 commit comments

Comments
 (0)