[Rails] Re: authorize state transitions

2010-02-15 Thread H.J. Blok
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

[Rails] Re: authorize state transitions

2010-01-21 Thread Brian Hughes
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