Skip to content

Commit

Permalink
Add documentation for permitted_transitions
Browse files Browse the repository at this point in the history
  • Loading branch information
dnamsons committed Feb 8, 2020
1 parent d4eb2a2 commit 703cdb4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1141,6 +1141,10 @@ job = Job.new
job.aasm.states(permitted: true).map(&:name)
#=> [:running]

# List all the permitted transitions(event and state pairs) from initial state
job.aasm.permitted_transitions
#=> [{ :event => :run, :state => :running }]

job.run
job.aasm.states(permitted: true).map(&:name)
#=> [:sleeping]
Expand Down

0 comments on commit 703cdb4

Please sign in to comment.