0
我的事件定义是这样的:如何使用aasm将传递给事件的参数传递给错误块?
event :share, after: :inc_in_path_share do
transitions from: :bucketed, to: :shared
error do |e|
inc_share(message, tags)
end
end
,我把它叫做my_instance.share(message, tags)
。如果允许转换,我可以用message
和tags
拨打inc_in_path_share
。但是当转换不被允许时,我想要在我的error
块中有一个inc_share
处理的默认操作。
如何将消息和标记传递给error
块?可能是我认为它不是最好的方式(XY问题)。谢谢 !