我是 AASM 的新手,并试图获取 MyModel 模型中可以转换为状态的所有状态的列表:newstate。
因此,例如:
aasm_event :finish do
transitions :to => :finalstate, :from => [:start, :working]
end
基本上,我想通过模型返回 [:start, :working] 数组,所以类似于
MyModel.aasm_events.finish.transitions.from
但是,好吧,这不是语法......我在文档中找不到任何东西。
任何建议表示赞赏。