Skip to content

Commit

Permalink
refactor: rename scope to differentiate it from the constant
Browse files Browse the repository at this point in the history
  • Loading branch information
stanleypliu committed Jun 8, 2021
1 parent f290303 commit b4e18c1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/models/geo_entity.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ class GeoEntity < ApplicationRecord
scope :regions, -> { where(iso3: nil) }

# Only allowing actual countries to be considered for the 'Next country' button
scope :allowed_countries, lambda {
scope :valid_countries, lambda {
countries.includes(:geo_entity_stats).where(iso3: ALLOWED_COUNTRIES).where.not(geo_entity_stats: { id: nil })
}

NEGATIVE_OCCURRENCE_STATUSES = %w[unknown absent present-but-unknown].freeze


def self.permitted_countries
allowed_countries.sort_by(&:name)
valid_countries.sort_by(&:name)
end

# Returns species data if directly attached to the GeoEntity, so a country.
Expand Down

0 comments on commit b4e18c1

Please sign in to comment.