Hi Patrick,

I would suggest to add a virtual column and adding a corresponding
setter in your model in wich you trigger your state machine method.

--
Volker

On Jun 21, 7:11 am, patrick99e99 <[email protected]> wrote:
> Well, I am not sure if this is the best way to go, but I accomplished
> this by doing:
>
>   def before_update_save(post)
>     if post.status_changed?
>       # store the current status method
>       status = post.status
>
>       # reset the status back to what it was
>       post.status = post.status_was
>
>       # call the state_machine method on the post
>       post.send(status)
>     end
>   end

-- 
You received this message because you are subscribed to the Google Groups 
"ActiveScaffold : Ruby on Rails plugin" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en.

Reply via email to