I created a project using state Machine, the state obtained when preparing to retrieve the state from the database and return it to the front-end is nil. The state field in the database has values, and the following is my definition of the state machine:
state_machine initial: :leader_pending do
state :leader_pending, :value => 1
state :it_pending, :value => 2
state :user_pending, :value => 3
state :manager_pending, :value => 4
state :finance_pending, :value => 5
event :leader_to_process do
transition :leader_pending => :it_pending
end
event :it_to_process do
transition :it_pending => :user_pending
end
event :user_to_process do
transition :user_pending => :manager_pending
end
event :user_return_process do
transition :user_pending => :it_pending
end
event :manager_to_process do
transition :manager_pending => :finance_pending
end
I created a project using state Machine, the state obtained when preparing to retrieve the state from the database and return it to the front-end is nil. The state field in the database has values, and the following is my definition of the state machine:
end