Skip to content

Commit 923d32e

Browse files
authored
Update for Ecto 3.12.0 change (#57)
* Fix for tuples in tuples, with Ecto 3.12.0 Enums * Fix Enum value order ambiguity, by sorting them
1 parent 4ad0211 commit 923d32e

File tree

6 files changed

+7
-6
lines changed

6 files changed

+7
-6
lines changed

lib/ecto/erd/document/dbml.ex

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ defmodule Ecto.ERD.Document.DBML do
8989
fields
9090
|> Enum.flat_map(fn
9191
%Field{name: name, type: {:parameterized, Ecto.Enum, %{on_dump: on_dump}}} ->
92-
[{source, name, Map.values(on_dump)}]
92+
values = on_dump |> Map.values() |> Enum.sort()
93+
[{source, name, values}]
9394

9495
_ ->
9596
[]

lib/ecto/erd/document/dot.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ defmodule Ecto.ERD.Document.Dot do
144144
defp format_field(%Field{name: name}, :name), do: inspect(name)
145145
defp format_field(%Field{type: type}, :type), do: format_type(type)
146146

147-
defp format_type({:parameterized, Ecto.Enum, %{on_dump: on_dump}}) do
147+
defp format_type({:parameterized, {Ecto.Enum, %{on_dump: on_dump}}}) do
148148
"#Enum<#{inspect(Enum.sort(Map.keys(on_dump)), limit: 10)}>"
149149
end
150150

lib/ecto/erd/document/plantuml.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ defmodule Ecto.ERD.Document.PlantUML do
124124
|> Enum.join(" ")
125125
end
126126

127-
defp format_type({:parameterized, Ecto.Enum, %{on_dump: on_dump}}) do
127+
defp format_type({:parameterized, {Ecto.Enum, %{on_dump: on_dump}}}) do
128128
elements_limit = 10
129129
values = Map.values(on_dump)
130130
length = length(values)

lib/ecto/erd/document/quick_dbd.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ defmodule Ecto.ERD.Document.QuickDBD do
6060
)
6161
end
6262

63-
defp format_type({:parameterized, Ecto.Enum, %{on_dump: on_dump}}) do
63+
defp format_type({:parameterized, {Ecto.Enum, %{on_dump: on_dump}}}) do
6464
"enum(#{Enum.join(Map.values(on_dump), ",")})"
6565
end
6666

mix.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ defmodule Ecto.ERD.MixProject do
7575
[
7676
{:ex_doc, "~> 0.24", only: :dev, runtime: false},
7777
{:html_entities, "~> 0.5"},
78-
{:ecto, "~> 3.10"},
78+
{:ecto, "~> 3.12"},
7979
{:dialyxir, "~> 1.0", only: [:dev], runtime: false}
8080
]
8181
end

mix.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"decimal": {:hex, :decimal, "2.1.1", "5611dca5d4b2c3dd497dec8f68751f1f1a54755e8ed2a966c2633cf885973ad6", [:mix], [], "hexpm", "53cfe5f497ed0e7771ae1a475575603d77425099ba5faef9394932b35020ffcc"},
33
"dialyxir": {:hex, :dialyxir, "1.4.3", "edd0124f358f0b9e95bfe53a9fcf806d615d8f838e2202a9f430d59566b6b53b", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "bf2cfb75cd5c5006bec30141b131663299c661a864ec7fbbc72dfa557487a986"},
44
"earmark_parser": {:hex, :earmark_parser, "1.4.39", "424642f8335b05bb9eb611aa1564c148a8ee35c9c8a8bba6e129d51a3e3c6769", [:mix], [], "hexpm", "06553a88d1f1846da9ef066b87b57c6f605552cfbe40d20bd8d59cc6bde41944"},
5-
"ecto": {:hex, :ecto, "3.11.2", "e1d26be989db350a633667c5cda9c3d115ae779b66da567c68c80cfb26a8c9ee", [:mix], [{:decimal, "~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "3c38bca2c6f8d8023f2145326cc8a80100c3ffe4dcbd9842ff867f7fc6156c65"},
5+
"ecto": {:hex, :ecto, "3.12.1", "626765f7066589de6fa09e0876a253ff60c3d00870dd3a1cd696e2ba67bfceea", [:mix], [{:decimal, "~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "df0045ab9d87be947228e05a8d153f3e06e0d05ab10c3b3cc557d2f7243d1940"},
66
"erlex": {:hex, :erlex, "0.2.6", "c7987d15e899c7a2f34f5420d2a2ea0d659682c06ac607572df55a43753aa12e", [:mix], [], "hexpm", "2ed2e25711feb44d52b17d2780eabf998452f6efda104877a3881c2f8c0c0c75"},
77
"ex_doc": {:hex, :ex_doc, "0.32.1", "21e40f939515373bcdc9cffe65f3b3543f05015ac6c3d01d991874129d173420", [:mix], [{:earmark_parser, "~> 1.4.39", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_c, ">= 0.1.1", [hex: :makeup_c, repo: "hexpm", optional: true]}, {:makeup_elixir, "~> 0.14", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1", [hex: :makeup_erlang, repo: "hexpm", optional: false]}], "hexpm", "5142c9db521f106d61ff33250f779807ed2a88620e472ac95dc7d59c380113da"},
88
"html_entities": {:hex, :html_entities, "0.5.2", "9e47e70598da7de2a9ff6af8758399251db6dbb7eebe2b013f2bbd2515895c3c", [:mix], [], "hexpm", "c53ba390403485615623b9531e97696f076ed415e8d8058b1dbaa28181f4fdcc"},

0 commit comments

Comments
 (0)