how to deal with user_id

20 views
Skip to first unread message

Brad Langhorst

unread,
Feb 14, 2012, 3:21:00 PM2/14/12
to PluginAWeek: Talk
I need to track which users cause state transitions...

How is this handled?

I'm running state_machine in a rails 2 environment and have an
after_transition callback set up to store state history
Should I create a method on the model to store the user or is there
some way to add a user argument to the events?

Aaron Pfeifer

unread,
Feb 17, 2012, 6:54:50 AM2/17/12
to pluginaw...@googlegroups.com
Hi Brad -

Thanks for the question.  See the "Defining additional arguments" section at http://rubydoc.info/github/pluginaweek/state_machine/StateMachine/Machine#event-instance_method.  This'll describe how to pass arguments into events and reference them within transitions callbacks.

Hope this helps!

Best,
Aaron
Reply all
Reply to author
Forward
0 new messages