If I try and change the state of an unsaved object I get the following
error. If I first save the object then do the call it is fine… is
this a known bug or am I doing something wrong? (most likely the
latter!)
pt.accept!
NoMethodError: You have a nil object when you didn’t expect it!
The error occurred while evaluating nil.to_sym
from vendor/plugins/acts_as_state_machine/lib/
acts_as_state_machine.rb:151:incurrent_state' from vendor/plugins/acts_as_state_machine/lib/ acts_as_state_machine.rb:92:in
next_states’
from vendor/plugins/acts_as_state_machine/lib/
acts_as_state_machine.rb:92:inselect' from vendor/plugins/acts_as_state_machine/lib/ acts_as_state_machine.rb:92:in
next_states’
from vendor/plugins/acts_as_state_machine/lib/
acts_as_state_machine.rb:96:infire' from vendor/plugins/acts_as_state_machine/lib/ acts_as_state_machine.rb:206:in
accept!’