Quick change to ensure geocoding call when latitude is absent

This commit is contained in:
echarp 2019-11-05 19:46:18 +01:00
parent 06c654c348
commit 0723960f7b

View File

@ -28,7 +28,7 @@ class Event < ApplicationRecord
geocoded_by :full_address
after_validation :geocode, if: (lambda do |obj|
obj.address_changed? || obj.city_changed?
obj.address_changed? || obj.city_changed? || latitude.nil?
end)
# Mechanism to store some reason which can be used when sending notifications