1
0
Fork 0
mirror of https://github.com/aasm/aasm synced 2023-03-27 23:22:41 -04:00

Updated README.md to refect actual code necessary to get states

Code listing for Inspection did not reflect the code necessary to produce the output that was indicated.

job.aasm.states produces an array of AASM::State objects, which need mapping to produce the symbols necessary.
This commit is contained in:
Daniel Lo 2014-03-20 10:20:27 -07:00
parent 85ed696500
commit 76484b39c5

View file

@ -431,13 +431,13 @@ Given the `Job` class from above:
```ruby
job = Job.new
job.aasm.states
job.aasm.states.map { | state | state.name }
=> [:sleeping, :running, :cleaning]
job.aasm.states(:permissible => true)
job.aasm.states(:permissible => true).map { | state | state.name }
=> [:running]
job.run
job.aasm.states(:permissible => true)
job.aasm.states(:permissible => true).map { | state | state.name }
=> [:cleaning, :sleeping]
job.aasm.events