fix: support accepting the :state attribute

fixes #36
This commit is contained in:
Zach Daniel 2024-06-11 13:53:09 -04:00
parent 22f0743f48
commit c540d50593
2 changed files with 6 additions and 0 deletions

View file

@ -6,6 +6,8 @@ defmodule AshStateMachine.Transformers.AddState do
def before?(Ash.Resource.Transformers.DefaultAccept), do: true
def before?(_), do: false
def after?(Ash.Resource.Transformers.DefaultAccept), do: false
def after?(_), do: true
def transform(dsl_state) do

View file

@ -31,6 +31,10 @@ defmodule Order do
# create sets the st
defaults [:create, :read]
create :create_with_state do
accept [:state]
end
update :confirm do
# accept [...] you can change other attributes
# or do anything else an action can normally do