From e7b12787b50251b8c18e109f4f61bce6e70b7c3f Mon Sep 17 00:00:00 2001 From: Ben Tregenna Date: Fri, 10 Jul 2020 14:29:23 +0100 Subject: [PATCH] Addressed PR comments by removing dead code --- app/models/pame_evaluation.rb | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/app/models/pame_evaluation.rb b/app/models/pame_evaluation.rb index e5600e14f..5c6f988a3 100644 --- a/app/models/pame_evaluation.rb +++ b/app/models/pame_evaluation.rb @@ -55,9 +55,7 @@ class PameEvaluation < ApplicationRecord title: 'Metadata ID', field: 'metadata_id' } - ] - - SORTING = [''] + ].freeze def self.paginate_evaluations(json=nil, order=nil) json_params = json.nil? ? nil : JSON.parse(json) @@ -219,19 +217,6 @@ def self.filters_to_json ].to_json end -SELECT_STATEMENT = [ - 'DISTINCT pame_evaluations.id AS assessment_id', 'pame_evaluations.metadata_id AS metadata_id', - 'pame_evaluations.url AS url', 'pame_evaluations.year AS year', - 'pame_evaluations.methodology AS methodology', 'pame_evaluations.wdpa_id AS wdpa_id', - 'pame_sources.data_title AS source_data_title', 'pame_sources.resp_party AS source_resp_party', - 'pame_sources.year AS source_year', 'pame_sources.language AS source_language', - 'pame_evaluations.protected_area_id AS protected_area_id', 'protected_areas.name AS protected_area_name', - 'designations.name AS designation', 'ARRAY_TO_STRING(ARRAY_AGG(countries.iso_3),\';\') AS countries' -].freeze - -GROUP_BY = "pame_evaluations.id, protected_areas.wdpa_id, protected_areas.name, designation, pame_sources.data_title, - pame_sources.resp_party, pame_sources.year, pame_sources.language".freeze - def self.generate_csv(where_statement, restricted_where_statement) where_statement = where_statement.empty? ? '' : "WHERE #{where_statement}" restricted_where_statement = restricted_where_statement.empty? ? '' : "WHERE #{restricted_where_statement}"