Brian, thanks for your answer. It works.

I don't know why it didn't work the first time I was trying to authorize 
the state transition. Maybe I've overlooked something.

Thanks,

HJ

Brian Hughes wrote:
> If you are using state_machine, this kind of thing is pretty
> straightforward. What you want to do is define a before_transition
> rule that calls a method in your model (I recommend a private method,
> for this, with a name ending in ?). Have that method return true when
> you want to allow the transition, or false when you don't.
> State_machine will handle the rest and set an error message on your
> model object.
> 
> You can also set your own errors, in the method that the
> before_transition calls, when you are going to return false.
> 
> -Brian

-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to