You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
events|>Enum.each(fn(event)->unlessevent[:to]instatesdoraise"Target state :#{event[:to]} is not present in @states"enddefunquote(event[:name])(model)domodel|>Changeset.change(%{unquote(column)=>"#{unquote(event[:to])}"})|>unquote(event[:callback]).()|>unquote(:"validate_state_transition_#{column}")(unquote(event),model)enddefunquote(:"can_#{event[:name]}?")(model)do:"#{Map.get(model,unquote(column))}"inunquote(event[:from])endend)defpunquote(:"validate_state_transition_#{column}")(changeset,event,model)dochange=Map.get(model,unquote(column))if:"#{change}"inevent[:from]dochangesetelsechangeset|>Changeset.add_error(unquote(column),"You can't move state from :#{change} to :#{event[:to]}")endend
The text was updated successfully, but these errors were encountered:
h4cc
added a commit
to digimondo/ecto_state_machine
that referenced
this issue
Nov 28, 2016
Fix would be to use this:
The text was updated successfully, but these errors were encountered: