Here is the string spec:
"state :initial_state do
event :submit, :transitions_to => :acct_init_reviewing
end
state :paid
state :rejected"
We need to convert it into plain ruby code inside a workflow loop:
workflow do
state :initial_state do
event :submit, :transitions_to => :acct_init_reviewing
end
state :paid
state :rejected
end
We tried eval without luck:
workflow do
eval(spec)
end
eval(spec) returns nil. How to convert a string into plain ruby code for execution?