Files
openfoodnetwork/app/services/default_country.rb
Maikel Linke f971131888 Cache default country for an hour
The default country usually never changes after the initial setup of an
instance.
2022-11-02 15:33:43 +11:00

16 lines
248 B
Ruby

# frozen_string_literal: true
class DefaultCountry
def self.id
country.id
end
def self.code
country.iso
end
def self.country
Spree::Country.cached_find_by(iso: ENV["DEFAULT_COUNTRY_CODE"]) || Spree::Country.first
end
end