From 26c1dfce9392e65c20cf348fbded1fc1542c82c4 Mon Sep 17 00:00:00 2001 From: Mark Longair Date: Fri, 1 Nov 2013 18:34:15 +0000 Subject: Update the calculation of the numerator for percentage statistics We have changed the denominator of the proportion-based statistics to only include requests that are both visible and not 'awaiting_description'. This would mean, however, that the numerator could be larger than the denominator. This commit updates the calculation of those statistics to also exclude any hidden or unclassified requests. --- lib/tasks/stats.rake | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib/tasks') diff --git a/lib/tasks/stats.rake b/lib/tasks/stats.rake index eb36204c6..1d08866a4 100644 --- a/lib/tasks/stats.rake +++ b/lib/tasks/stats.rake @@ -103,7 +103,11 @@ namespace :stats do overdue_count = 0 very_overdue_count = 0 InfoRequest.find_each(:batch_size => 200, - :conditions => {:public_body_id => public_body.id}) do |ir| + :conditions => { + :public_body_id => public_body.id, + :awaiting_description => false, + :prominence => 'normal' + }) do |ir| case ir.calculate_status when 'waiting_response_very_overdue' very_overdue_count += 1 -- cgit v1.2.3