2
我的理解是可以做到如何使用「在哪裏」,「有」和「或」
scope :public_visible, where("(status = ?) OR (end_date > ?)", :published, Date.today)
但我想要做的是以下兩個作用域與OR
結合什麼範圍scope :succeeded, having("SUM(orders.sum) >= goal")
scope :ongoing, where("end_date >= ?", Date.today)
這可能嗎?無論是以sql還是主動記錄的方式。
謝謝大家。