demarches-normaliennes/config/initializers/geocoder.rb
2024-08-22 09:26:48 +02:00

9 lines
426 B
Ruby

# frozen_string_literal: true
cache_configuration = if Rails.cache.respond_to?(:redis)
{ cache: Rails.cache.redis, cache_options: { prefix: "geocoder:", expiration: 6.hours } }
else
{ cache: Geocoder::CacheStore::Generic.new(Rails.cache, { prefix: "geocoder:" }) } # generic uses default Rails.cache expiration as of geocoder 1.8
end
Geocoder.configure(lookup: :ban_data_gouv_fr, use_https: true, **cache_configuration)