写组合搜索就有些别的优雅的办法吗?
product = Product.all
product = product.where(...) if this_params[...].present?
product = product.where(...) if this_params[...].present?
product = product.where(...) if this_params[...].present?
product.page(...)
每次写个组合的搜索就像上面那样,一堆的东西,字段越多,判断就越多,有木有什么好的办法呢?