ilabsolutions/acts_as_state_machine — pull request #3 by clayenga (2014-12-25 00:28:43+00:00)
Title: Allow testing states on new models

This fix makes the following work:

- MyModel.new.my_state?
- MyModel.new.current_state

Otherwise they break because state is nil, which is inconvenient - for
example, you couldn't call those methods in a validation because it
would break first time you save.

Side note:

You could manually set the state before saving but you shouldn't have
to. (IMO, acts_as_state_machine should set the state when the object
is initialized, not when it is persisted, but I'm not sure about the
implications to our codebase of changing this...)