0

私は顧客のために 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

4

1 に答える 1

4

これはあなたが望むものです:

http://ar-paranoid.rubyforge.org/

于 2009-09-17T15:25:14.203 に答える