mirror of
https://github.com/ash-project/ash_state_machine.git
synced 2024-09-19 21:03:33 +12:00
parent
22f0743f48
commit
c540d50593
2 changed files with 6 additions and 0 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue