Reputation: 1422
I have a Ruby on Rails app with geocoder gem installed. I am trying to bulk geocode all rows (approx. 2500) in my database with rake geocode:all. When I run the command nothing happened. None of the rows were geocoded. Am I missing something here?
Model.rb
geocoded_by :fulladdress
after_validation :geocode
def fulladdress
[address, city, state, zip].compact.join(",")
end
Upvotes: 1
Views: 448
Reputation: 3632
Just try to run outside of the Rake task manually (e.g. rails console or rails runner):
Model.find_each {|m| m.save! }
If you do it in development have a quick look over the outputted SQL Statements, if there lines with "UPDATE models SET lat=?, lon=? ..."
Upvotes: 2