X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/b7b9ea44ada30b1251fb10c872cb1da1d7c29bd0..f6a485f2af3665d66d93621d3e0c40ee3e541eef:/apps/workbench/app/controllers/application_controller.rb diff --git a/apps/workbench/app/controllers/application_controller.rb b/apps/workbench/app/controllers/application_controller.rb index 648cae85a6..10c33c3f0a 100644 --- a/apps/workbench/app/controllers/application_controller.rb +++ b/apps/workbench/app/controllers/application_controller.rb @@ -241,6 +241,28 @@ class ApplicationController < ActionController::Base end end + helper_method :next_page_filters + def next_page_filters nextpage_operator + next_page_filters = @filters.reject do |attr, op, val| + (attr == 'created_at' and op == nextpage_operator) or + (attr == 'uuid' and op == 'not in') + end + + if @objects.any? + last_created_at = @objects.last.created_at + + last_uuids = [] + @objects.each do |obj| + last_uuids << obj.uuid if obj.created_at.eql?(last_created_at) + end + + next_page_filters += [['created_at', nextpage_operator, last_created_at]] + next_page_filters += [['uuid', 'not in', last_uuids]] + end + + next_page_filters + end + def show if !@object return render_not_found("object not found")