Closed mtc2013 closed 10 years ago
yes it is.
`validation: false' just prevent you from having an error added to your model. https://github.com/apneadiving/Google-Maps-for-Rails/blob/master/lib/gmaps4rails/model_handler.rb#L67
I don't advise you to keep this option.
The wider context here is we want to give users the ability to edit an address but keep their edit in place even if geocoding fails for some reason, but then let the app attempt to recode it later so that the user is not disrupted in his workflow
Is there some easy way of achieving this with your gem?
You could:
I'm tryin to imlpement the scenario u've described in ur last reply, but I have problems: when validation fails, I remove validation errors in after_validation hook and I still need to save this record with invalid address (as validate? is false, transaction rollbacks and save is not performed). How can i do this? And in after_validation hook I try to set self.gmaps = false, but it still tries to geocode if I run @model.save! . Thanks in advance! Your support is great!
My initial cucumber scenarios seem to indicate it keeps the old geo-coding coordinates when an address is updated but geo-coding fails. It then doesn't seem to retry the geocoding when the map is refreshed. Is this accurate?