我有一个模型:
class CashPayment < ActiveRecord::Base
.....
**enum status: [:processing, :paid, :invalid,:refund]**
end
在这里,我已宣布 cash_payment 的状态无效。但它给了我如下错误:
*** ArgumentError Exception: You tried to define an enum named "status" on the model "CashPayment", but this will generate a instance method "invalid?", which is already defined by Active Record