私は顧客のために ActiveRecord を作成しましたが、顧客はそれを望んでいるので、それが破棄されたとき、実際には手動のロールバックのために保持されます。
私がやりたいのは、「アクティブ」と呼ばれるブール属性を作成することです。デフォルトは 1 です。レコードが破棄されると、属性は 0 に切り替わります。
I know I could change all my queries to have an extra condition of active=1, or use scoping, or even use the type column and inheritance (which is what I'm doing to complete it ASAP).
Is there any way to tell an ActiveRecord that a record in the table is actually a record ONLY if an attribute is a certain value (in this case active=1), and if it's anything else, completely ignore it?
Thanks, Andrew