ecto_state_machine icon indicating copy to clipboard operation
ecto_state_machine copied to clipboard

Feature: Validate change without needing an event

Open joffotron opened this issue 8 years ago • 1 comments

We came into a case where we needed to do state transitions on our Ecto models, but the new state would be received from user input (e.g an API call)

So instead of using a large conditional, and then using the can_x? / event functions to change state, we put together a simple ecto validation to check that the transition was a valid one.

It would be great if this could be considered for inclusion in the main repo - any feedback is welcome!

Thanks! Joff

joffotron avatar Feb 23 '17 04:02 joffotron

@asiniy Hi! Sorry this has taken a while!

I think we have a more comprehensive set of tests now - let me know if there's anything else you need :-)

joffotron avatar May 22 '17 05:05 joffotron