mirror of
https://github.com/ash-project/ash_state_machine.git
synced 2024-09-20 05:13:26 +12:00
chore: format & credo
This commit is contained in:
parent
f17d117b28
commit
8bec910e5e
3 changed files with 4 additions and 4 deletions
|
@ -10,6 +10,5 @@ defmodule AshStateMachine.Errors.InvalidInitialState do
|
||||||
"""
|
"""
|
||||||
Attempted to set initial state to `:#{error.target}` in action `:#{error.action}`, but it is not a valid initial state.
|
Attempted to set initial state to `:#{error.target}` in action `:#{error.action}`, but it is not a valid initial state.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -83,14 +83,14 @@ defmodule Mix.Tasks.AshStateMachine.GenerateFlowCharts do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
defp is_state_machine?(module) do
|
defp state_machine?(module) do
|
||||||
Spark.Dsl.is?(module, Ash.Resource) and AshStateMachine in Spark.extensions(module)
|
Spark.Dsl.is?(module, Ash.Resource) and AshStateMachine in Spark.extensions(module)
|
||||||
end
|
end
|
||||||
|
|
||||||
defp state_machines do
|
defp state_machines do
|
||||||
for module <- modules(),
|
for module <- modules(),
|
||||||
{:module, module} = Code.ensure_compiled(module),
|
{:module, module} = Code.ensure_compiled(module),
|
||||||
is_state_machine?(module) do
|
state_machine?(module) do
|
||||||
module
|
module
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -66,7 +66,8 @@ defmodule AshStateMachineTest do
|
||||||
|
|
||||||
changes do
|
changes do
|
||||||
# any failures should be captured and transitioned to the error state
|
# any failures should be captured and transitioned to the error state
|
||||||
change after_transaction(fn changeset, {:ok, result}, _ ->
|
change after_transaction(fn
|
||||||
|
changeset, {:ok, result}, _ ->
|
||||||
{:ok, result}
|
{:ok, result}
|
||||||
|
|
||||||
changeset, {:error, error}, _ ->
|
changeset, {:error, error}, _ ->
|
||||||
|
|
Loading…
Reference in a new issue