From 847a349a6bd6a7257e8bf1ec98c580596516c2db Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Sat, 29 Feb 2020 12:40:40 +0100 Subject: [PATCH] Fix geocoding in Rails 4 :tada: Responsibility for geocoding has moved from the `gmaps4rails` gem using `acts_as_taggable`, to the `geocoding` gem using `geocoded_by`. We already use this in the Address model. --- app/models/enterprise.rb | 2 -- config/initializers/geocoder.rb | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/app/models/enterprise.rb b/app/models/enterprise.rb index 3c356134fc..52b5ccac4e 100644 --- a/app/models/enterprise.rb +++ b/app/models/enterprise.rb @@ -17,8 +17,6 @@ class Enterprise < ActiveRecord::Base self.inheritance_column = nil - # acts_as_gmappable process_geocoding: false - has_many :relationships_as_parent, class_name: 'EnterpriseRelationship', foreign_key: 'parent_id', dependent: :destroy diff --git a/config/initializers/geocoder.rb b/config/initializers/geocoder.rb index 35b5510d5e..67ae27e7e4 100644 --- a/config/initializers/geocoder.rb +++ b/config/initializers/geocoder.rb @@ -1,6 +1,7 @@ # Google requires an API key with a billing account to use their API. # The key is stored in config/application.yml. Geocoder.configure( + lookup: :google, use_https: true, api_key: ENV.fetch('GOOGLE_MAPS_API_KEY', nil) )