0

我在 Rails 3.2 应用程序中使用以下范围:

scope :consumable, lambda { where('expiration_date > ?', Date.today) }

在使用 Ruby 2.0 的 Rails 4 中实现相同的正确语法是什么?

4

1 回答 1

2
scope :consumable, -> { where('expiration_date > ?', Date.today) }
于 2013-07-16T15:59:50.630 回答