state_machine v0.1.1 StateMachine.Ecto
Ecto additions simplify working with Ecto structures. When using StateMachine with Ecto, we assume that model is a changeset. This introduces indirection in reading and updating state.
TODO: Full example
Link to this section Summary
Functions
This macro defines an Ecto.Type implementation inside of StateMachine namespace.
The default name would be StateType
, but you can supply any module name.
The purpose of this is to be able to cast string into atom and back safely,
validating it against StateMachine defition.
Link to this section Functions
define_ecto_type(name \\ StateType) (macro)
This macro defines an Ecto.Type implementation inside of StateMachine namespace.
The default name would be StateType
, but you can supply any module name.
The purpose of this is to be able to cast string into atom and back safely,
validating it against StateMachine defition.