improvement: support ash 2.0 properly

This commit is contained in:
Zach Daniel 2022-08-23 14:56:13 -04:00
parent 0d1d5b5465
commit b2f0e77d09
5 changed files with 16 additions and 16 deletions

View file

@ -467,8 +467,8 @@ defmodule AshPhoenix.Form.Auto do
case Map.get(root, relationship.join_relationship) do
value when is_list(value) ->
Enum.find(value, fn join ->
Map.get(join, relationship.destination_field_on_join_table) ==
Map.get(parent, relationship.destination_field)
Map.get(join, relationship.destination_attribute_on_join_resource) ==
Map.get(parent, relationship.destination_attribute)
end)
_ ->

View file

@ -1,5 +1,5 @@
defmodule AshPhoenix.Form.NoFormConfigured do
@moduledoc "Raised when attempting to refer to a form but no nested form with that name was configured.
@moduledoc "Raised when attempting to refer to a form but no nested form with that name was configured."
defexception [:field, :available, :path]
def exception(opts) do

View file

@ -24,14 +24,14 @@ defmodule AshPhoenix.DocIndex do
AshPhoenix.LiveView,
AshPhoenix.FormData.Error,
AshPhoenix.SubdomainPlug
],
{"Errors",
[
AshPhoenix.Form.InvalidPath,
AshPhoenix.Form.NoActionConfigured,
AshPhoenix.Form.NoDataLoaded,
AshPhoenix.Form.NoFormConfigured,
AshPhoenix.FOrm.NoResourceConfigured
]}}
]},
{"Errors",
[
AshPhoenix.Form.InvalidPath,
AshPhoenix.Form.NoActionConfigured,
AshPhoenix.Form.NoDataLoaded,
AshPhoenix.Form.NoFormConfigured,
AshPhoenix.FOrm.NoResourceConfigured
]}
]
end

View file

@ -1,5 +1,5 @@
%{
"ash": {:git, "https://github.com/ash-project/ash.git", "e975522d1fdb79534ae2857ecd8bc0c6821150a7", [branch: "2.0"]},
"ash": {:hex, :ash, "2.0.0-pre.3", "ff898168575694e284832e79ef5cfb24065f1b27a9b5dae6780a907ca5d0eeb0", [:mix], [{:comparable, "~> 1.0", [hex: :comparable, repo: "hexpm", optional: false]}, {:decimal, "~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:earmark, "~> 1.4", [hex: :earmark, repo: "hexpm", optional: true]}, {:ecto, "~> 3.7", [hex: :ecto, repo: "hexpm", optional: false]}, {:ets, "~> 0.8.0", [hex: :ets, repo: "hexpm", optional: false]}, {:jason, ">= 1.0.0", [hex: :jason, repo: "hexpm", optional: false]}, {:nimble_options, "~> 0.4.0", [hex: :nimble_options, repo: "hexpm", optional: false]}, {:picosat_elixir, "~> 0.2", [hex: :picosat_elixir, repo: "hexpm", optional: false]}, {:spark, "~> 0.1 and >= 0.1.9", [hex: :spark, repo: "hexpm", optional: false]}, {:stream_data, "~> 0.5.0", [hex: :stream_data, repo: "hexpm", optional: false]}], "hexpm", "c85e45fbcad5926788a7e4cc92e32c68cd78ab66061d52dad15ac390f453107a"},
"bunt": {:hex, :bunt, "0.2.0", "951c6e801e8b1d2cbe58ebbd3e616a869061ddadcc4863d0a2182541acae9a38", [:mix], [], "hexpm", "7af5c7e09fe1d40f76c8e4f9dd2be7cebd83909f31fee7cd0e9eadc567da8353"},
"certifi": {:hex, :certifi, "2.9.0", "6f2a475689dd47f19fb74334859d460a2dc4e3252a3324bd2111b8f0429e7e21", [:rebar3], [], "hexpm", "266da46bdb06d6c6d35fde799bcb28d36d985d424ad7c08b5bb48f5b5cdd4641"},
"comparable": {:hex, :comparable, "1.0.0", "bb669e91cedd14ae9937053e5bcbc3c52bb2f22422611f43b6e38367d94a495f", [:mix], [{:typable, "~> 0.1", [hex: :typable, repo: "hexpm", optional: false]}], "hexpm", "277c11eeb1cd726e7cd41c6c199e7e52fa16ee6830b45ad4cdc62e51f62eb60c"},
@ -40,7 +40,7 @@
"plug_crypto": {:hex, :plug_crypto, "1.2.2", "05654514ac717ff3a1843204b424477d9e60c143406aa94daf2274fdd280794d", [:mix], [], "hexpm", "87631c7ad914a5a445f0a3809f99b079113ae4ed4b867348dd9eec288cecb6db"},
"sobelow": {:hex, :sobelow, "0.11.1", "23438964486f8112b41e743bbfd402da3e5b296fdc9eacab29914b79c48916dd", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "9897363a7eff96f4809304a90aad819e2ad5e5d24db547af502885146746a53c"},
"sourceror": {:hex, :sourceror, "0.11.2", "549ce48be666421ac60cfb7f59c8752e0d393baa0b14d06271d3f6a8c1b027ab", [:mix], [], "hexpm", "9ab659118896a36be6eec68ff7b0674cba372fc8e210b1e9dc8cf2b55bb70dfb"},
"spark": {:hex, :spark, "0.1.11", "7415e7775d4cc9ed898bf082e60cfa2bdebd71a690c09b5f92b6f8f05d6be992", [:mix], [{:libgraph, "~> 0.13.3", [hex: :libgraph, repo: "hexpm", optional: false]}, {:nimble_options, "~> 0.4.0", [hex: :nimble_options, repo: "hexpm", optional: false]}, {:sourceror, "~> 0.1", [hex: :sourceror, repo: "hexpm", optional: false]}], "hexpm", "1c4df53d53f952a8f6cb7876b6499032870f0eceb8ef55e48aa0b3bc61a5eba0"},
"spark": {:hex, :spark, "0.1.16", "a9a16b649d93be0cef24aab8a1ab9c5d37f6abeaefe0e7084fb0a55e14017d5c", [:mix], [{:libgraph, "~> 0.13.3", [hex: :libgraph, repo: "hexpm", optional: false]}, {:nimble_options, "~> 0.4.0", [hex: :nimble_options, repo: "hexpm", optional: false]}, {:sourceror, "~> 0.1", [hex: :sourceror, repo: "hexpm", optional: false]}], "hexpm", "fbabce247695dabad777fe59aec28646a8e0d6cf59b4c4d2a9a1de5bf88e2a2d"},
"ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.6", "cf344f5692c82d2cd7554f5ec8fd961548d4fd09e7d22f5b62482e5aeaebd4b0", [:make, :mix, :rebar3], [], "hexpm", "bdb0d2471f453c88ff3908e7686f86f9be327d065cc1ec16fa4540197ea04680"},
"stream_data": {:hex, :stream_data, "0.5.0", "b27641e58941685c75b353577dc602c9d2c12292dd84babf506c2033cd97893e", [:mix], [], "hexpm", "012bd2eec069ada4db3411f9115ccafa38540a3c78c4c0349f151fc761b9e271"},
"telemetry": {:hex, :telemetry, "1.1.0", "a589817034a27eab11144ad24d5c0f9fab1f58173274b1e9bae7074af9cbee51", [:rebar3], [], "hexpm", "b727b2a1f75614774cff2d7565b64d0dfa5bd52ba517f16543e6fc7efcc0df48"},

View file

@ -56,8 +56,8 @@ defmodule AshPhoenix.Test.Post do
many_to_many(:linked_posts, AshPhoenix.Test.Post,
through: AshPhoenix.Test.PostLink,
destination_field_on_join_table: :destination_post_id,
source_field_on_join_table: :source_post_id
destination_attribute_on_join_resource: :destination_post_id,
source_attribute_on_join_resource: :source_post_id
)
end
end