在state_machine中,如何找到当前状态下哪些事件是有效的?
我在我的 Rails3 应用程序中使用 Aaron Pfeifer 的 state_machine gem - 它很漂亮。
如何获取当前状态下合法的事件列表?我的意思是不是的意思是my_model.state_path.events
它返回所有可从当前状态传递的事件——我只想要那些在当前状态下可用。
我很确定我只是忽略了一些显而易见的事情。
I am using Aaron Pfeifer's state_machine gem in my Rails3 app -- it's nifty.
How do get a list of events are legal in the current state? By this, I do not mean my_model.state_path.events
which returns all events transitively traceable from the current state -- I want only those that are available in the current state.
I'm pretty sure I'm simply overlooking something obvious.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Aaron 本人在 PluginAWeek:Core 组邮件列表上回答了这个问题:
Aaron himself answered the question on the PluginAWeek:Core group mailing list: