> I've just started using state_machine gem and it has already cleaned
> up a lot of my code. I do however need to do 1 specific thing and
> can't figure out from the README if/how this can be done.
> All the code will be used in a Rails 3 app.
> Let's say I have an article model which looks something like this:
> state_machine :state, :initial => :new do
> event :submit_for_approval do
> transition [:new, :declined] => :pending
> end
> event :decline do
> transition [:pending] => :declined
> end
> event :approve do
> transition [:pending, :declined] => :published
> end
> end
> This will give me the following methods (among others):
> submit_for_approval, approve and decline.
> Let's say I would like to keep a log of whoever performed these
> actions on the given article.
> I know there is something called state_machine-audit_trail, however
> this only logs the changes.
> I would like to pass in the invoker of the change in the
> submit_for_approval, approve and decline methods. How can I achieve
> this ?
> If this is not possible or considered a bad practice what would you
> suggest ?
> --
> You received this message because you are subscribed to the Google Groups
> "PluginAWeek: Talk" group.
> To post to this group, send email to pluginaweek-talk@googlegroups.com.
> To unsubscribe from this group, send email to
> pluginaweek-talk+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/pluginaweek-talk?hl=en.