improvement: set context_to_opts when constructing the query

This commit is contained in:
Zach Daniel 2023-12-08 10:53:11 -05:00
parent 7c700c4fd2
commit 1fcc2abc37

View file

@ -32,7 +32,7 @@ defmodule AshDoubleEntry.Transfer.Changes.VerifyTransfer do
changeset.resource
|> AshDoubleEntry.Transfer.Info.transfer_account_resource!()
|> Ash.Query.filter(id in ^[from_account_id, to_account_id])
|> Ash.Query.for_read(:lock_accounts)
|> Ash.Query.for_read(:lock_accounts, context_to_opts(context, authorize?: false))
|> Ash.Query.load(balance_as_of_ulid: %{ulid: result.id})
|> changeset.api.read!(context_to_opts(context, authorize?: false))