Skip to content

Commit a92bea8

Browse files
committed
use Ecto's new :parametrized representation
1 parent 996d40c commit a92bea8

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

lib/polymorphic_embed.ex

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -604,9 +604,9 @@ defmodule PolymorphicEmbed do
604604
_ in UndefinedFunctionError ->
605605
reraise ArgumentError, "#{inspect(schema)} is not an Ecto schema", __STACKTRACE__
606606
else
607-
{:parameterized, PolymorphicEmbed, options} -> Map.put(options, :array?, false)
608-
{:array, {:parameterized, PolymorphicEmbed, options}} -> Map.put(options, :array?, true)
609-
{_, {:parameterized, PolymorphicEmbed, options}} -> Map.put(options, :array?, false)
607+
{:parameterized, {PolymorphicEmbed, options}} -> Map.put(options, :array?, false)
608+
{:array, {:parameterized, {PolymorphicEmbed, options}}} -> Map.put(options, :array?, true)
609+
{_, {:parameterized, {PolymorphicEmbed, options}}} -> Map.put(options, :array?, false)
610610
nil -> raise ArgumentError, "#{field} is not a polymorphic embed"
611611
end
612612
end
@@ -668,7 +668,7 @@ defmodule PolymorphicEmbed do
668668
end
669669

670670
defp polymorphic_key_reducer(
671-
{field, {:parameterized, PolymorphicEmbed, _opts}},
671+
{field, {:parameterized, {PolymorphicEmbed, _opts}}},
672672
acc,
673673
changes,
674674
msg_func
@@ -707,7 +707,7 @@ defmodule PolymorphicEmbed do
707707
end
708708

709709
defp polymorphic_key_reducer(
710-
{field, {:array, {:parameterized, PolymorphicEmbed, _opts}}},
710+
{field, {:array, {:parameterized, {PolymorphicEmbed, _opts}}}},
711711
acc,
712712
changes,
713713
msg_func

0 commit comments

Comments
 (0)