:prefix
-option to avoid name collision if you define multiple state machines on the same model, and use state names more than once
state_machine
-definitions like this:
class Form
state_machine :first_wizard_stage do
state :completed
end
state_machine :second_wizard_stage do
state :completed
end
end
would produce the following warning:
rails_state_machine-2.1.1/lib/rails_state_machine/state_machine.rb:62: warning: already initialized constant Form::STATE_COMPLETED
:prefix
-option:
class Form
state_machine :first_wizard_stage, prefix: :foo do
state :completed
end
state_machine :second_wizard_stage, prefix: :bar do
state :completed
end
end
Form::STATE_FOO_COMPLETED
and Form::STATE_BAR_COMPLETE
#foo_completed?
and #bar_completed?