Lifecycle manual is incorrect about procs and end states
Reported by Juho | August 22nd, 2009 @ 02:19 PM
The manual states
This transition can only be fired in the state or states given as from, which can be either a symbol or an array of symbols. On completion of this transition, the record will be in the state give as to which can be one of:
* A symbol – the name of the state
* A proc – if the proc takes one argument it is called with the record, if it takes none it is instance_eval‘d on the record. Should return the name of the state
* A string – evaluated as a Ruby expression with in the context of the record</code>
But what the code does
def get_state(record, state)
case state
when Proc
state.call(record)
when String
eval(state, record.instance_eval { binding })
else
state
end
end
So it's not instance_evaled when there are no arguments.
Comments and changes to this ticket
-
Bryan Larsen August 28th, 2009 @ 02:24 PM
- State changed from new to resolved
Fixed by updating the source rather than the docs. 3e9e999
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
See http://cookbook.hobocentral.net