alexreisner/geocoder — Issue #188: SQLite3::SQLException: no such column: latitude: SELECT "cities".* FROM "cities"  WHERE (latitude IS NULL OR longitude IS NULL) 
Author: mkhezr
Created: 2012-02-28 22:04:53+00:00
State: open

Hi,

I'm porting code from an older rails application which used the geocoder gem. There is this City model which uses non default lat/lng columns instead of latitude/longitude. This code used to work fine but now when I run "rake geocode:all CLASS=City" I get the following error:

SQLite3::SQLException: no such column: latitude: SELECT "cities".* FROM "cities" WHERE (latitude IS NULL OR longitude IS NULL)

Below is what teh model code is and I have also copied the migration code:

class City < ActiveRecord::Base

geocoded_by :latitude => :lat, :longitude => :lng

end

class CreateCities < ActiveRecord::Migration
def change
create_table :cities do |t|
t.string :name
t.decimal :lat, :precision => 9, :scale => 6
t.decimal :lng, :precision => 9, :scale => 6

t.timestamps
end
end
end

I'm using ruby 1.9.2 and rails 3.2.1.

Thanks,
Maryam