如果可能的话,我想减少这个查询:
@orders_in_progress = user.orders.where("state = ? OR state = ? OR state = ?, "Waiting for Payment Authorization", "Paid", "Shipped")
我正在寻找的是这样的:
@orders_in_progress = user.orders.where("state = ?", "Waiting for Payment Authorization" || "Paid" || "Shipped)
另外,我对这里的术语有点困惑——这是“一个元素的多个条件的 ActiveRecord 查询”吗?