如何在 AASM 中调用状态更改方法?
当状态转换为以下模型中的已付款时,我想调用 update_foo :
class Foo < ActiveRecord::Base
include AASM
# State Machine
aasm_initial_state :incomplete
aasm_state :incomplete
aasm_state :paid
aasm_event :pay do
transitions :from => :incomplete, :to => :paid
end
def update_foo
...
end
end