我有一个支出表。 它有一栏发票。
I would like 2 scopes - one for billed expenses and one for not billed. I thought I could just test to see if invoice_id was nil.
scope :notbilled, where(:invoice_id == nil)
scope :billed, where(:invoice_id != nil)
但是,这并不奏效。
任何想法?
Thanks!