Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/ash/action_input.ex
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ defmodule Ash.ActionInput do
resource: Ash.Resource.t(),
invalid_keys: MapSet.t(),
context: map(),
domain: Ash.Domain.t(),
domain: Ash.Domain.t() | nil,
valid?: boolean(),
errors: [Ash.Error.t()],
before_action: [before_action_fun],
Expand Down Expand Up @@ -132,7 +132,7 @@ defmodule Ash.ActionInput do
- `set_argument/3` for adding arguments
- `set_context/2` for adding context
"""
@spec new(Ash.Resource.t(), Ash.Domain.t()) :: t
@spec new(Ash.Resource.t(), Ash.Domain.t() | nil) :: t
def new(resource, domain \\ nil) do
%__MODULE__{resource: resource, domain: domain}
end
Expand Down
16 changes: 12 additions & 4 deletions lib/ash/actions/bulk_manual_action_helpers.ex
Original file line number Diff line number Diff line change
Expand Up @@ -87,21 +87,29 @@ defmodule Ash.Actions.BulkManualActionHelpers do
case result do
{:ok, record} ->
record =
Ash.Resource.put_metadata(
record,
record
|> Ash.Resource.put_metadata(
metadata_index_name,
changeset.context[bulk_action_type].index
)
|> Ash.Resource.put_metadata(
:bulk_action_ref,
changeset.context[bulk_action_type].ref
)

{:ok, record}

{:ok, record, notifications} ->
record =
Ash.Resource.put_metadata(
record,
record
|> Ash.Resource.put_metadata(
metadata_index_name,
changeset.context[bulk_action_type].index
)
|> Ash.Resource.put_metadata(
:bulk_action_ref,
changeset.context[bulk_action_type].ref
)

{:ok, record, notifications}

Expand Down
Loading