From 7fd1d17a4374de8b9969b33fb6756b6c804ba393 Mon Sep 17 00:00:00 2001 From: Madeline OLeary Date: Mon, 5 Jun 2023 10:10:41 +0200 Subject: [PATCH] factors nil cases into approved points selection --- lib/tasks/service.rake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tasks/service.rake b/lib/tasks/service.rake index aeab051c..3033875a 100644 --- a/lib/tasks/service.rake +++ b/lib/tasks/service.rake @@ -26,7 +26,7 @@ namespace :service do services = Service.all puts "Getting unreviewed services" services.where('is_comprehensively_reviewed = false').each do |service| - approved_points = service.points.where("status = 'approved'"); + approved_points = service.approved_points if approved_points.length >= 20 puts "Found #{service.name} - #{service.id}" service.is_comprehensively_reviewed = true