Skip to content

Commit

Permalink
Fix Readme for next_state.
Browse files Browse the repository at this point in the history
  • Loading branch information
merqlove committed Mar 30, 2018
1 parent 2b6ebd3 commit 69f27ff
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ defmodule User do
use EctoAsStateMachine

easm states: [:unconfirmed, :confirmed, :blocked, :admin],
initial: :unconfirmed,
events: [
[
name: :confirm,
Expand All @@ -139,7 +140,7 @@ defmodule User do
end

user = Repo.get_by(User, id: 1) # state: unconfirmed
new_user = user.next_state # state: confirmed
new_user = User.next_state(user) # state: confirmed
```

## Contributions
Expand Down

0 comments on commit 69f27ff

Please sign in to comment.