X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/8b7ed36ff057c4a483f4ee8a1c66929425b366c6..eff37344f3cecd5aed259c9852aca4bdcdfb6922:/services/api/lib/load_param.rb diff --git a/services/api/lib/load_param.rb b/services/api/lib/load_param.rb index 3f1a3b223a..35f1d0b640 100644 --- a/services/api/lib/load_param.rb +++ b/services/api/lib/load_param.rb @@ -47,10 +47,6 @@ module LoadParam end end - def default_orders - ["#{table_name}.modified_at desc"] - end - # Load params[:limit], params[:offset] and params[:order] # into @limit, @offset, @orders def load_limit_offset_order_params @@ -113,9 +109,11 @@ module LoadParam end end - if @orders.empty? - @orders = default_orders - end + # If the client-specified orders don't amount to a full ordering + # (e.g., [] or ['owner_uuid desc']), fall back on the default + # orders to ensure repeating the same request (possibly with + # different limit/offset) will return records in the same order. + @orders += model_class.default_orders case params[:select] when Array