views:

107

answers:

1

I want to be able to utilize the acts_as_state_machine transition methods which are auto-generated (e.g. event!).. but I don't want it to save right away. I'm updating the state as part of another set of operations, and so I don't want to be doing double saves.

Is there any way to trigger these event methods without a save right afterward?

+5  A: 

By looking at acts_as_state_machine's code (line 65) I found that it is defining event-methods without a bang too. This will update the state internally in the object without storing it to the database. Hope that helps :-)

Thorbjørn Hermansen