Skip to content

Commit

Permalink
Addressed PR comments by removing dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Tregenna authored and Ben Tregenna committed Jul 10, 2020
1 parent c68da23 commit e7b1278
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions app/models/pame_evaluation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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}"
Expand Down

0 comments on commit e7b1278

Please sign in to comment.