#4 ✓resolved
Juho

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

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.

New-ticket Create new ticket

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

Shared Ticket Bins

People watching this ticket

Pages