Shared by etagwerker
Autobombo. acts_as_state_machine rocks.
This is a note to self. Remember to define all states for an object before you start referencing it.
If not, you will get an error like this:
“You have a nil object when you didn’t expect it! The error occurred while evaluating nil.entering”
This is the solution:
1 2 3 4 5 6 7 8 |
class Squad < ActiveRecord::Base acts_as_state_machine :initial => :in_progress event :complete do transitions … |
©2010. Postage by Greg Cooper. Icons by PixelResort. Thanks to Jamie Cassidy & Panic.
*Unlikely to find your lost post using this but you can try...