From f99a3bd114d3aeaec240771b07dd2ad7064179c9 Mon Sep 17 00:00:00 2001 From: Stanley Liu Date: Wed, 5 Aug 2020 12:14:04 +0100 Subject: [PATCH] added back pa_count method in stats::global as i thought it was one of my added methods --- Gemfile | 4 +--- lib/modules/stats/global.rb | 4 ++++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index 14e91378f..f11e80be7 100644 --- a/Gemfile +++ b/Gemfile @@ -36,9 +36,7 @@ gem 'sprockets-vue', '~> 0.1.0' gem 'rails-controller-testing' -# gem 'gdal', '~> 2.0' -# TODO Stanley - Need to remove the below -gem 'gdal', '~> 3.0' +gem 'gdal', '>= 2.0' # group :production, :staging do # gem 'unicorn' diff --git a/lib/modules/stats/global.rb b/lib/modules/stats/global.rb index aab9a267a..2b60a8275 100644 --- a/lib/modules/stats/global.rb +++ b/lib/modules/stats/global.rb @@ -1,6 +1,10 @@ class Stats::Global IUCN_CATEGORIES = "'Ia', 'Ib', 'II', 'II', 'IV', 'V', 'VI'" + def self.pa_count + ProtectedArea.count + end + def self.percentage_pa_cover RegionalStatistic.joins(:region) .where('regions.iso' => 'GLOBAL')