diff --git a/lib/ash/actions/managed_relationships.ex b/lib/ash/actions/managed_relationships.ex index ddaca857..f143fca2 100644 --- a/lib/ash/actions/managed_relationships.ex +++ b/lib/ash/actions/managed_relationships.ex @@ -714,6 +714,7 @@ defmodule Ash.Actions.ManagedRelationships do relationship.through |> Ash.Changeset.new() + |> Ash.Changeset.for_create(create_or_update, join_input) |> Ash.Changeset.force_change_attribute( relationship.source_field_on_join_table, Map.get(record, relationship.source_field) @@ -722,7 +723,6 @@ defmodule Ash.Actions.ManagedRelationships do relationship.destination_field_on_join_table, Map.get(found, relationship.destination_field) ) - |> Ash.Changeset.for_create(create_or_update, join_input) |> Ash.Changeset.set_context(join_relationship.context) |> Ash.Changeset.set_tenant(changeset.tenant) |> api.create( @@ -878,6 +878,7 @@ defmodule Ash.Actions.ManagedRelationships do relationship.through |> Ash.Changeset.new() + |> Ash.Changeset.for_create(join_action_name, join_params) |> Ash.Changeset.force_change_attribute( relationship.source_field_on_join_table, Map.get(record, relationship.source_field) @@ -886,7 +887,6 @@ defmodule Ash.Actions.ManagedRelationships do relationship.destination_field_on_join_table, Map.get(created, relationship.destination_field) ) - |> Ash.Changeset.for_create(join_action_name, join_params) |> Ash.Changeset.set_context(join_relationship.context) |> Ash.Changeset.set_tenant(changeset.tenant) |> changeset.api.create(