Files
openfoodnetwork/app/helpers/map_helper.rb
Luis Ramos e52937c113 Use rubocop auto correct to add frozen string literal to all files
This is an unsafe auto corection, we will need to trust our build here
2021-06-17 23:07:26 +01:00

16 lines
371 B
Ruby

# frozen_string_literal: true
module MapHelper
def using_google_maps?
ENV["GOOGLE_MAPS_API_KEY"].present? || google_maps_configured_with_geocoder_api_key?
end
private
def google_maps_configured_with_geocoder_api_key?
ENV["GEOCODER_API_KEY"].present? && (
ENV["GEOCODER_SERVICE"].to_s == "google" || ENV["GEOCODER_SERVICE"].blank?
)
end
end