From c68407dea1a6474450bbeccdd52d8305a8bbc75a Mon Sep 17 00:00:00 2001 From: Tom Clegg Date: Tue, 31 Dec 2013 09:44:57 -0800 Subject: [PATCH] Add "items_available" (integer) to generic list response. --- services/api/app/controllers/application_controller.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/services/api/app/controllers/application_controller.rb b/services/api/app/controllers/application_controller.rb index de0c50c578..c6e7da0e11 100644 --- a/services/api/app/controllers/application_controller.rb +++ b/services/api/app/controllers/application_controller.rb @@ -335,6 +335,9 @@ class ApplicationController < ActionController::Base :next_link => "", :items => @objects.as_api_response(nil) } + if @objects.respond_to? :except + @object_list[:items_available] = @objects.except(:limit).count + end render json: @object_list end -- 2.39.5