我现在使用 ransacks 来进行搜索操作
@q = Order.ransack(params[:q].merge(shipping_print_status_eq: Shipping::PrintStatus::PRINTING))
@orders = @q.result(distinct: true)
@orders = @orders.includes(:shipping).order("shippings.print_at DESC NULLS LAST")
error
ActiveRecord::StatementInvalid - PG::InvalidColumnReference: ERROR: for SELECT DISTINCT, ORDER BY expressions must appear in select list
请问不使用 .to_a.uniq 这种方法怎么来解决