Skip to content
Extraits de code Groupes Projets
Valider 4f8cf33f rédigé par echarp's avatar echarp
Parcourir les fichiers

Geocoding only occurs avec address has changed

parent f1a286d8
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -27,8 +27,9 @@ class Event < ActiveRecord::Base ...@@ -27,8 +27,9 @@ class Event < ActiveRecord::Base
validates :submitter, email: true validates :submitter, email: true
geocoded_by :full_address geocoded_by :full_address
# after_validation :geocode, if: -> (obj) { obj.address_changed? } after_validation :geocode, if: (lambda do |obj|
after_validation :geocode obj.address_changed? || obj.city_changed?
end)
# Mechanism to store some reason which can be used when sending notifications # Mechanism to store some reason which can be used when sending notifications
attr_accessor :reason attr_accessor :reason
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
# #
# It's strongly recommended that you check this file into your version control system. # It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20161210105333) do ActiveRecord::Schema.define(version: 20161210154558) do
create_table "active_admin_comments", force: :cascade do |t| create_table "active_admin_comments", force: :cascade do |t|
t.string "namespace", limit: 255 t.string "namespace", limit: 255
...@@ -70,7 +70,7 @@ ActiveRecord::Schema.define(version: 20161210105333) do ...@@ -70,7 +70,7 @@ ActiveRecord::Schema.define(version: 20161210105333) do
t.string "contact", limit: 255, default: "", null: false t.string "contact", limit: 255, default: "", null: false
t.string "submitter", limit: 255, default: "", null: false t.string "submitter", limit: 255, default: "", null: false
t.integer "moderated", limit: 4, default: 0, null: false t.integer "moderated", limit: 4, default: 0, null: false
t.text "tags", limit: 255, default: "", null: false t.text "tags", limit: 255, default: ""
t.string "secret", limit: 255, default: "", null: false t.string "secret", limit: 255, default: "", null: false
t.datetime "decision_time" t.datetime "decision_time"
t.datetime "submission_time" t.datetime "submission_time"
...@@ -124,7 +124,7 @@ ActiveRecord::Schema.define(version: 20161210105333) do ...@@ -124,7 +124,7 @@ ActiveRecord::Schema.define(version: 20161210105333) do
t.datetime "created_at" t.datetime "created_at"
t.datetime "updated_at" t.datetime "updated_at"
t.text "tag" t.text "tag"
t.text "tags", default: "", null: false t.text "tags", default: ""
t.text "diaspora" t.text "diaspora"
t.text "object_changes" t.text "object_changes"
t.text "place_name" t.text "place_name"
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter