問題タブ [aasm]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
ruby-on-rails - aasm: error in after event callback cancels the event
I have an aasm event which looks like this:
now, I've noticed that when I call close! and there's an error on action2, the event is not saved in the db. I guess that the order of things is 1. transition of the instance 2. after callbacks 3. save
except for catching the error under the 'after' block level, is there a callback that is triggered after the 'save' which I can use ?
ruby-on-rails - Ruby gem aasm では、ブール値の結果を返すガード関数に not(!) 演算子を定義できますか?
私が書かなければならないコードの量を減らすために、ガード関数で !:cancelled のようなものを持つことは可能ですか? それとも、別の not_cancelled を書く必要がありますか? 機能します(私が推測しているように)。
Ruby 2.1 と gem 'aasm', '~> 3.1.1' を使用しています
ruby-on-rails - AASM: aasm_column に従ってレコードを並べ替える
これらはモデルの状態であり、aasm_column の状態に従ってレコードを並べ替える必要があります。たとえば、5 つのレコードがあり、それらはすべて異なる状態になっています。ここで、すべてのレコードを取得する必要があり、最初は「未払い」、次に「有料」などのように並べ替える必要があります。それを達成するためのエレガントな方法がある場合。
ruby - act_as_state_machine の状態遷移図を生成するツール
ruby gemacts_as_state_machine
は、柔軟な有限状態マシン フレームワーク内でオブジェクトのライフサイクルをモデル化するのに非常に役立ちます。しかし、状態遷移を視覚的に表現したいと思うことがよくあります。
既存の Ruby クラスから FSM ダイアグラム (ステート ダイアグラム フローチャート、ステート/イベント テーブル、UML など) を生成するツールはありacts_as_state_machine
ますか?
ruby-on-rails - Rails AASM 自動状態遷移
私は、AASM
gem を使用して特定のオブジェクトをさまざまな状態に遷移させる Rails アプリに取り組んでいます。
「承認済み」の属性が false に設定されている場合のみ、「事前承認」の初期状態が必要です。AASM
gemを使用して自動トランジションを行う方法はありますか?
状態は次のとおりです。
ruby-on-rails - GET リクエストに対して AASM を実行させる Grape Rails API
ここに私のAASMがあります
ここに私の新しいAPIがあります
これが私が受け取っているエラーです:
AASM::InvalidTransition (Event 'approved' cannot transition from 'pending'):
にログインしてrails console
実行するCompany.first.service_requests
と、完全に機能し、アプリケーション内で を押すと実行されるservice_requests_path
ため、この API 呼び出しが問題を引き起こしている理由がわかりません
ruby - aasm gemで状態の履歴を保持する方法はありますか?
この宝石が状態の履歴を保持する方法を提供するかどうか疑問に思っています。おそらく各イベントにコールバックを追加することでこれを行うことができますが、他の人がこのアプローチについてどう思うか疑問に思っています.