2024-07-12 15:59:03 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
2024-08-05 15:23:08 -04:00
|
|
|
config = {
|
2024-03-17 13:16:45 -04:00
|
|
|
# geocoding service request timeout, in seconds (default 3):
|
|
|
|
|
# timeout: 5,
|
|
|
|
|
|
|
|
|
|
# set default units to kilometers:
|
|
|
|
|
units: :km,
|
|
|
|
|
|
|
|
|
|
# caching (see Caching section below for details):
|
|
|
|
|
cache: Redis.new,
|
|
|
|
|
cache_options: {
|
2024-07-12 15:59:03 -04:00
|
|
|
expiration: 1.day # Defaults to `nil`
|
2024-03-17 13:16:45 -04:00
|
|
|
# prefix: "another_key:" # Defaults to `geocoder:`
|
|
|
|
|
}
|
2024-08-05 15:23:08 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ENV['GOOGLE_PLACES_API_KEY'].present?
|
|
|
|
|
config[:lookup] = :google
|
|
|
|
|
config[:api_key] = ENV['GOOGLE_PLACES_API_KEY']
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
Geocoder.configure(config)
|