Permalink
Browse files

Update geokit to version 1.8.3

  • Loading branch information...
1 parent 4241cc7 commit cd7d63794be38301e8069739aef9771c6142db9b @sferik sferik committed Dec 31, 2013
Showing with 7 additions and 4 deletions.
  1. +1 −1 Gemfile.lock
  2. +3 −2 app/models/thing.rb
  3. +0 −1 config/initializers/geokit.rb
  4. +3 −0 test/controllers/addresses_controller_test.rb
View
@@ -58,7 +58,7 @@ GEM
fastercsv (1.5.5)
font-awesome-rails (4.0.3.0)
railties (>= 3.2, < 5.0)
- geokit (1.7.1)
+ geokit (1.8.3)
multi_json (>= 1.3.2)
haml (4.0.4)
tilt
View
@@ -1,6 +1,7 @@
+require 'geokit'
+
class Thing < ActiveRecord::Base
include ActiveModel::ForbiddenAttributesProtection
- include Geokit::Geocoders
validates_uniqueness_of :city_id, :allow_nil => true
validates_presence_of :lat, :lng
belongs_to :user
@@ -17,7 +18,7 @@ def self.find_closest(lat, lng, limit=10)
end
def reverse_geocode
- @reverse_geocode ||= MultiGeocoder.reverse_geocode([lat, lng])
+ @reverse_geocode ||= Geokit::Geocoders::MultiGeocoder.reverse_geocode([lat, lng])
end
def street_number
@@ -1 +0,0 @@
-Geokit::Geocoders::provider_order = [:google3]
@@ -13,6 +13,9 @@ class AddressesControllerTest < ActionController::TestCase
stub_request(:get, "http://maps.google.com/maps/api/geocode/json").
with(:query => {:address => ", ", :sensor => "false"}).
to_return(:body => File.read(File.expand_path('../../fixtures/unknown_address.json', __FILE__)))
+ stub_request(:get, "http://geocoder.us/service/csv/geocode").
+ with(:query => {:address => ", "}).
+ to_return(:body => File.read(File.expand_path('../../fixtures/unknown_address.json', __FILE__)))
get :show, :address => '', :city_state => '', :format => 'json'
assert_response :missing
end

0 comments on commit cd7d637

Please sign in to comment.