ruby AASM gem を使用しています。
状態をスキップする正しい方法を知っている人はいますか?
class Job
# ...
event :stage1_completed do
if stage2_completed?
transitions from: :stage1, :to => :stage3
else
transitions from: :stage1, :to => :stage2
end
end
# ...
end
AASM でこれを設定する最良の方法は何ですか?
このコードを一連の resque ジョブで使用しているため、stage1 は resque ジョブであり、状態を更新して次の resque ジョブを開始します。ステージ 2、次にステージ 3 も同様