From d8ff8190331b2aa4c1ef4412548a83ce0147ef03 Mon Sep 17 00:00:00 2001 From: Will Kocur Date: Thu, 10 Nov 2022 16:00:05 +0000 Subject: [PATCH] fix: count multiple pame evaluations for same protected area on country page --- app/controllers/country_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/country_controller.rb b/app/controllers/country_controller.rb index 676bf0e34..f54e4a36e 100644 --- a/app/controllers/country_controller.rb +++ b/app/controllers/country_controller.rb @@ -17,7 +17,7 @@ def show @flag_path = flag_path(@country.name) - @total_pame = @country.protected_areas.with_pame_evaluations.count + @total_pame = @country.protected_areas.map(&:pame_evaluations).flatten.count @total_wdpa = @country.protected_areas.wdpas.count @map = {