Skip to content

Commit

Permalink
fix: add tenant to load in cascade update (#1773)
Browse files Browse the repository at this point in the history
  • Loading branch information
barnabasJ authored Feb 6, 2025
1 parent cf68e7f commit 1f35fff
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/ash/resource/change/cascade_update.ex
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ defmodule Ash.Resource.Change.CascadeUpdate do

defp update_related(_, [], _, _), do: :ok

defp update_related(changeset, data, opts, context) do
defp update_related(changeset, data, opts, %{tenant: tenant} = context) do
action = opts.action
relationship = opts.relationship
copies = opts.copy_inputs
Expand Down Expand Up @@ -228,7 +228,8 @@ defmodule Ash.Resource.Change.CascadeUpdate do
{relationship.name,
Ash.Query.set_context(relationship.destination, %{cascade_update: true})}
],
authorize?: false
authorize?: false,
tenant: tenant
)
|> Enum.flat_map(fn record ->
record
Expand Down

0 comments on commit 1f35fff

Please sign in to comment.