From 7b0804dea255ee6f327238eb04f5da004e68cf22 Mon Sep 17 00:00:00 2001 From: James Harton Date: Fri, 8 Sep 2023 15:36:58 +1200 Subject: [PATCH] fix: Allow `next_state` to to match transitions from *. --- lib/builtin_changes/next_state.ex | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/builtin_changes/next_state.ex b/lib/builtin_changes/next_state.ex index 2e19157..034df22 100644 --- a/lib/builtin_changes/next_state.ex +++ b/lib/builtin_changes/next_state.ex @@ -13,7 +13,8 @@ defmodule AshStateMachine.BuiltinChanges.NextState do changeset.resource |> AshStateMachine.Info.state_machine_transitions(changeset.action.name) |> Enum.filter(fn - %{from: from} when is_list(from) -> current_state in from + %{from: from} when is_list(from) -> current_state in from || :* in from + %{from: :*} -> true %{from: from} -> current_state == from end) |> Enum.flat_map(fn