Bugfix. Objects returned by owned_items are now sorted by uuid in order to get
authorPeter Amstutz <peter.amstutz@curoverse.com>
Fri, 25 Apr 2014 19:44:29 +0000 (15:44 -0400)
committerPeter Amstutz <peter.amstutz@curoverse.com>
Fri, 25 Apr 2014 19:44:29 +0000 (15:44 -0400)
a stable sort order when paging with limit and offset.

services/api/app/controllers/application_controller.rb

index 6339125a00b69f2991353c8e6c91a7bb2f9be0c8..713f2cf8e4017e78f768fafc973034b1a4bdb604 100644 (file)
@@ -103,7 +103,7 @@ class ApplicationController < ActionController::Base
                   "    AND mng_links.head_uuid=#{klass.table_name}.uuid")
           cond_sql += " OR mng_links.uuid IS NOT NULL"
         end
-        @objects = @objects.where(cond_sql, *cond_params)
+        @objects = @objects.where(cond_sql, *cond_params).order(:uuid)
         @limit = limit_all - all_objects.count
         apply_where_limit_order_params
         items_available = @objects.