pluginaweek/state_machine — Issue #151: Custom validations can not be called twice
Author: pietere
Created: 2012-01-02 14:13:29+00:00
State: open

I have a state machine like this

'''
state_machine :publication_state, :initial => :in_preparation do
event :submit do
transition :draft => :submitted
end
event :refuse do
transition :submitted => :draft
end
event :accept do
transition :submitted => :published
end
state :submitted do
validate :validate_something_fancy
end
state :published do
validate :validate_something_fancy
end
end
'''

and then

'''
def validate_something_fancy
...
end
'''